users@jsr311.java.net

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

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Fri, 11 Jul 2008 22:12:13 +0200

Hi Marc,

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 ...

Stephan

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
>