Strabon

changeset 1120:4beeabbf8843

caught MalformedQueryException in QueryBean so as not to print the exception in the log (it is not a bug)
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Apr 29 00:14:11 2013 +0300 (2013-04-29)
parents f9116bfd4dd2
children b297e773ff56 22d502a6ee1d
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	Sun Apr 28 21:11:33 2013 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Mon Apr 29 00:14:11 2013 +0300
     1.3 @@ -30,6 +30,7 @@
     1.4  
     1.5  import org.apache.commons.io.FileUtils;
     1.6  import org.apache.commons.lang.StringEscapeUtils;
     1.7 +import org.openrdf.query.MalformedQueryException;
     1.8  import org.openrdf.query.resultio.TupleQueryResultFormat;
     1.9  import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    1.10  import org.slf4j.Logger;
    1.11 @@ -303,6 +304,10 @@
    1.12  									request.getServerName() + ":" + request.getServerPort() + 
    1.13  									"/" + tempDirectory + "/" + tempKMLFile);
    1.14  							
    1.15 +						} catch (MalformedQueryException e) {
    1.16 +							logger.error("[StrabonEndpoint.QueryBean] Error during querying. {}", e.getMessage());
    1.17 +							request.setAttribute(ERROR, e.getMessage());
    1.18 +							
    1.19  						} catch (Exception e) {
    1.20  							logger.error("[StrabonEndpoint.QueryBean] Error during querying.", e);
    1.21  							request.setAttribute(ERROR, e.getMessage());
    1.22 @@ -326,6 +331,10 @@
    1.23  							request.setAttribute(RESPONSE, StringEscapeUtils.escapeHtml(bos.toString()));
    1.24  						}
    1.25  						
    1.26 +					} catch (MalformedQueryException e) {
    1.27 +						logger.error("[StrabonEndpoint.QueryBean] Error during querying. {}", e.getMessage());
    1.28 +						request.setAttribute(ERROR, e.getMessage());
    1.29 +						
    1.30  					} catch (Exception e) {
    1.31  						logger.error("[StrabonEndpoint.QueryBean] Error during querying.", e);
    1.32  						request.setAttribute(ERROR, e.getMessage());