I know the basic idea is to use an ExceptionMapper, but I'm trying to decide what the best strategies are for working with this.
For instance, my current test case is getting a 403 status on an invalid request. My application determines this dynamically and throws a WebApplicationException with a FORBIDDEN response status. If I do nothing else, the client gets the 403 back, but with an empty response. It's possible that's ok, but perhaps not. I was wondering whether I should construct a reasonable-looking "error" object with an exception mapper. I suppose if I want to map that specific scenario I'll have to manually create a "AccessDeniedException", like Spring Security uses (I'm not going to integrate that just for one exception class :) ), and create the mapper with that. Otherwise, I can only map WebApplicationException, which is too generic for this particular case, although I might want a more general solution for that. What do people do in this area?
