Strabon

changeset 89:d7e748ccd2eb

added method for generating error messages enclosed in <exception> tags
author Babis Nikolaou <charnik@di.uoa.gr>
date Wed Apr 04 22:36:55 2012 +0300 (2012-04-04)
parents fe79e508b1a4
children 99c070b82188
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java	Wed Apr 04 21:25:40 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java	Wed Apr 04 22:36:55 2012 +0300
     1.3 @@ -52,7 +52,7 @@
     1.4  			
     1.5  		} catch(MalformedQueryException e) {
     1.6  			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
     1.7 -			answer = "<exception>\n"+e.getMessage()+"\n\t</exception>";
     1.8 +			answer = getExceptionError(e.getMessage());
     1.9  		}
    1.10  		
    1.11  		// write response to client
    1.12 @@ -78,5 +78,9 @@
    1.13  	public static String getUPDATEFooterResponse() {
    1.14  		return "\n</response>\n";
    1.15  	}
    1.16 +	
    1.17 +	public static String getExceptionError(String msg) {
    1.18 +		return "<exception>\n"+msg+"\n\t</exception>";
    1.19 +	}
    1.20  
    1.21  }