public Response toResponse(Exception ex) { if (ex instanceof AbortRuntimeException) { AbortRuntimeException abort = (AbortRuntimeException) ex; log.warn("{}", ex.getMessage()); log.debug("Exception occured.", ex); Event e = abort.getEvent(); Status status = getStatus(e); return Response.serverError().status(status).entity(e.getMessage()).build(); } else if (ex instanceof WebApplicationException) { WebApplicationException webex = (WebApplicationException) ex; return Response.serverError().status(webex.getResponse().getStatus()).build(); } else { log.warn("Unexpected INTERNAL_SERVER_ERROR ", ex); return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build(); } }
System.out.println(e.getEvent().getMessage());
System.out.println(e.getEvent().getMessage());