Adjusted exception messages.

This commit is contained in:
Leon Radeck committed 2017-08-21 02:51:50 +02:00
1 parent 6f66fc6efb
commit ab6be35a29
2 files changed
+1 -6

No files matched your search

@@ -135,8 +135,6 @@ public class EventsResource extends AbstractSailingServerResource {
return ok(regatta.getId().toString(), MediaType.TEXT_PLAIN);
}
@POST
@Path("/addCourseArea")
@Consumes("text/plain")
@@ -13,10 +13,7 @@ import org.apache.commons.lang.StringEscapeUtils;
@Provider
public class ExceptionManager implements ExceptionMapper<Exception>{
public Response toResponse(Exception exception) {
if(exception instanceof IllegalArgumentException){
return Response.status(400).entity("IllegalArgumentException: "+exception.getMessage()).type("text/plain").build();
}
return Response.status(300).entity("Internal Server Error").type("text/plain").build();
return Response.status(400).entity(exception.getMessage()).type("text/plain").build();
}
public static String invalidDateFormatMsg(String date) {