On Mar 10, 2008, at 7:01 PM, Reto Bachmann-Gmür wrote:
> After reading the editors Note 2.1 (in section 2.2.3 of the january
> 31 draft) I was wondering why there isn't a mechanism to convert
> types of (checked) exceptions to to WebApplicationsException
> (similar to the conversion of java-objects to message bodies).
>
> A use case would be various resource methods invoking methods on a
> backend-proxy which may throw BackendOverloadedExceptionS, instead
> that all resource methods catch this exception and throw a
> WebApplicationException with a explanatory response body, a single
> converter for BackendOverloadedException would be registered and the
> resource methods would just propagate the checked Exception.
>
To paraphrase you're saying we could treat the exception just like a
method return value and support the ability to have a provider handle
conversion to a HTTP response. Have to think about that some more but
it sounds like an interesting idea.
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.