I have an ExceptionMapper for my custom exception (which extends
RuntimeException).
When my exception is thrown from a resource method (annotated with
@Path ), it is correctly mapped through my instance of ExceptionMapper.
However, when my exception is thrown from @XmlAttribute-annotated
method in a JaxB bean (which in turn is returned by a resource method),
no mapping occurs.
Is this by design?
The current way to affect errors returned from JaxB methods seems to
wrap them into WebApplicationException which seems sub-optimal.
Is there any other way to map the exceptions from JaxB bean methods?