title: ExceptionMapper for WebApplicationExceptions thrown with entity?
body: <p>In our (legacy) codebase, we're throwing WebApplicationExceptions in different ways.
  In an attempt to make some order in how we're handling exceptions - I wanted to create an ExceptionMapper for these WAEs (and others).</p>
  
  <p>I realized, however, that Jersey's ExceptionMapper only maps WAE which weren't thrown with an entity.</p>
  
  <p>For example:</p>
  
  <pre><code>throw new WebApplicationException(Response.status(500).build());
  </code></pre>
  
  <p>This exception is caught by the ExceptionMapper.</p>
  
  <pre><code>throw new WebApplicationException(Response.status(500).entity(WsResourceUtils.createWSResourceRestError(500, "bla")).build());
  </code></pre>
  
  <p>This exception is NOT caught by the ExceptionMapper.</p>
  
  <p>Both are thrown from the same point in code.</p>
  
  <p>This is my ExceptionMapper:</p>
  
  <pre><code>@Provider
  public class GeneralExceptionMapper implements ExceptionMapper&lt;Throwable&gt; {
  
      private static final Logger logger = LoggerFactory.getLogger(GeneralExceptionMapper.class);
  
      @Override
      public Response toResponse(Throwable e) {
          logger.error("Caught a WAE", e);
  ...
  }
  </code></pre>
  
  <p>Is it possible to create an ExceptionMapper which will catch WebApplicationExceptions even if their response is already built with an entity?</p>
  
  <p>We're using Jersey 1.17.</p>
  
  <p>Thanks.</p>