I would like to be able to have code like:
try {
// ...
}
catch ( SomeException e ) {
response.setStatus( CLIENT_ERROR_BAD_REQUEST, e );
}
That is that you can pass a Throwable to setStatus() and that the
Status class have the additional methods of:
void setThrown( Throwable t );
Throwable getThrown();
The default implementation of the response that gets returned to the
client will simply do an:
t.getMessage()
and include that as the textual error message. However, if I
implement my own StatusService, I have full access to the exception.
In my case, I'd like to return an XML entity containing an XML-ized
version of the exception's stack trace.
- Paul