When I hit a jersey service and there is an exception in the service
implementation, the error isn't logged anywhere unless I put in log
handling around each method call like:
@GET @Path("/xml/{modelid}")
@Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML})
public String processModelXml(@PathParam("modelid") String modelId) {
try{
modelId = "Order Fulfillment";
String processModelXML =
glueProcessModelService.getProcessModelXML(modelId, 1);
return processModelXML;
}catch(Exception e){
Logger.log(e);
throw e;
}
It seems to me this isn't very DRY. Anyone know a better solution? Does
jersey have a facility to intercep all service exceptions?
Has anyone implemented an annotation type approach to handle this?
would be cool if I could put @HandleException on all methods which calls a
HandleException implementation...
thanks for any thoughts!
phil