Strabon

changeset 635:0f2fe2d2f251

logged errors in endpoint raised from wrong request parameters
author Babis Nikolaou <charnik@di.uoa.gr>
date Thu Oct 11 15:27:26 2012 +0200 (2012-10-11)
parents 95f6f0d699a4
children 0a2d39b80321
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Thu Oct 11 14:53:50 2012 +0200
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Thu Oct 11 15:27:26 2012 +0200
     1.3 @@ -36,7 +36,13 @@
     1.4  import org.springframework.web.context.WebApplicationContext;
     1.5  import org.springframework.web.context.support.WebApplicationContextUtils;
     1.6  
     1.7 -
     1.8 +/**
     1.9 + * 
    1.10 + * @author Kostis Kyzirakos <kkyzir@di.uoa.gr>
    1.11 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.12 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    1.13 + * @author Stella Giannakopoulou <sgian@di.uoa.gr>
    1.14 + */
    1.15  public class QueryBean extends HttpServlet {
    1.16  
    1.17  	private static final long serialVersionUID = -378175118289907707L;
    1.18 @@ -161,6 +167,7 @@
    1.19      	
    1.20      	// check for required parameters
    1.21      	if (format == null || query == null) {
    1.22 +    		logger.error("[StrabonEndpoint.QueryBean] {}", PARAM_ERROR);
    1.23      		response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    1.24  			out.print(ResponseMessages.getXMLHeader());
    1.25  			out.print(ResponseMessages.getXMLException(PARAM_ERROR));
    1.26 @@ -177,6 +184,7 @@
    1.27  				response.setStatus(HttpServletResponse.SC_OK);
    1.28  				
    1.29  			} catch (Exception e) {
    1.30 +				logger.error("[StrabonEndpoint.QueryBean] Error during querying.", e);
    1.31  				response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
    1.32  				out.print(ResponseMessages.getXMLHeader());
    1.33  				out.print(ResponseMessages.getXMLException(e.getMessage()));