title: How to get content type of the response in JAX-RS ExceptionMapper
body: <p>I have a resource:</p>
  
  <pre><code>@GET
  @Path("/print-order")
  @Produces("application/pdf")
  public byte[] printOrder(@QueryParam("id") Long orderId) {
      return ...;
  }
  </code></pre>
  
  <p>...which can throw an error that is relevant to the user and must be displayed as a HTML page. So I implemented an <code>ExceptionMapper</code> but I don't know how to get the value of <code>@Produces("application/pdf")</code> annotation of the called resource.</p>
  
  <pre><code>@Provider
  public class CustomExceptionMapper implements ExceptionMapper&lt;CustomException&gt; {
      @Override
      public Response toResponse(CustomException exception) {
          if (contentType = "application/pdf")
              ... html respone
          else
              ... entity response
      }
  }
  </code></pre>
  
  <p>I'm using JAX-RS 1.x (jsr311) with Jersy 1.12 implementation but would love to have implementation independent solution.</p>