JAX-RS jersey ExceptionMapper: How to know the method who threw the exception
<p>Im using JAX-RS jersey ExceptionMapper, and I'm wondering if there is a way to know inside the method toResponse(), which method (from the API) threw the exception.</p>

<p>Example (dummy code)</p>

<pre><code>@javax.ws.rs.Path(“/bookstore/books/{bookID}”)
public class Book {
    @javax.ws.rs.GET
    public String informationMethod(String user) {
        ...
            throw new Exception("Error");
        ....    
    }    
}



@Provider
public class SomeMapper implements ExceptionMapper&lt;Exception&gt; {
    @Override
    public Response toResponse(Exception ex) {

        //a way to get the method name that threw the exception. 
        //In the above example is: informationMethod.
        String methodName = //informationMethod

        return Response.status(500).entity(ex.getMessage()).type("text/plain")
                .build();
    }
}
</code></pre>