users@jsr311.java.net

Re: Telling ExceptionMapper to exclude exceptions

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 10 Oct 2008 10:23:49 -0400

On Oct 3, 2008, at 8:35 AM, cowwoc wrote:
>
> We need a portable mechanism to tell ExceptionMapper to catch all
> application-generated RuntimeExceptions but pass-through all
> exceptions generated by the underlying JAX-RS implementation (meant
> to be handled by the container, not our code). I suspect this is a
> very common use-case but there doesn't seem to be a way to do it.
>
Can you say a bit more about what you are trying to achieve. Only
certain exceptions are required to be processed by exception mappers:

- those thrown by a resource method
- those thrown by a provider method
- those thrown by the ctor or valueOf method of a resource field,
property or method parameter

It sounds like you want to be able to distinguish between say an
IllegalArgumentException thrown by UriBuilder vs one thrown by some
other API that a resource method uses but I'm struggling to see a use
case for that.

Thanks,
Marc.

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