users@jersey.java.net

Structured Exception handling

From: David Esposito <java.net_at_esposito.newnetco.com>
Date: Tue, 13 May 2008 09:24:07 -0400

Hello All,

I am trying to gracefully handle an Exception that is being raised by
the framework. (i.e. a failure to parse the request body into the
appropriate Java object (JAXB) due to schema errors). I have looked
through the source of WebApplicationImpl and see that the mechanism for
catching a WebApplicationException (onExceptionWithWebApplication) is
hard-coded to generate a text/plain response with the entire stack trace.

Is there a work item to allow an application to register an exception
listener/handler so that I can decide how I want to handle the exception
and generate the appropriate Response? (a la the Restlet.org
org.restlet.service.StatusService)

Adding a servlet filter doesn't seem appropriate since I will have lost
the context of the Exception by the time I reach the filter.

Thanks,
Dave