users@jsr311.java.net

Re: what to do, if a resource method throws an Error?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 14 Jul 2008 12:40:53 -0400

On Jul 11, 2008, at 4:12 PM, Stephan Koops wrote:
>
> I agree for Errors. I think we should define it. If a JAX-RS runtime
> env uses refections it has the Throwable in his
> InvocationTargetException and he has something to do with it. You
> could rethrow an Error, but not a Throwable, because it must be
> catched. But throw it away is also not good ...
>
Seems like the simplest solution is to treat Error like an unchecked
exception and Throwable like a checked exception.

Marc.

>
> Marc Hadley schrieb:
>> Errors represent something pretty serious going wrong, I don't
>> think a JAX-RS implementation should even catch them. Same for
>> Throwable and non-standard subclasses of Throwable I think.
>>
>> Marc.
>>
>> On Jul 11, 2008, at 1:54 PM, Stephan Koops wrote:
>>
>>> Hi,
>>>
>>> for checked and unchecked Exception from a resource method the JAX-
>>> RS spec defines what to do. What to do with Errors? and other
>>> Throwables? Errors the same as with unchecked Exceptions? And
>>> other Throwables? Also wrap into a container specific Exception?
>>>
>>> Constructors of root resource classes and providers may also throw
>>> Throwables.
>>>
>>> best regards
>>> Stephan
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.