title: JAX-RS exception mapper does not handle the exception that is thrown when doing parameter conversion?
body: <p>I created my own class with a fromString method which I believe JAXB will use to convert the parameter value string to my object. However, inside this fromString method, I have a try catch block which bubbles up the exception. Like the following.</p>
  
  <pre><code>public class Animal{
      public static Animal fromString(final String input){ 
  
          try{ 
              ... 
          }catch(IllegalArgumentException ae){ 
              throw new CannotConvertAnimalException(); //this is my custom exception 
          } 
      }
  }
  </code></pre>
  
  <p>And then I have a mapper for CannotConvertAnimalException like the following:</p>
  
  <pre><code>@Component
  @Provider
  public class CannotConvertAnimalExceptionHandler implements ExceptionMapper&lt;CannotConvertAnimalException&gt;
  </code></pre>
  
  <p>The thing is that in my resource method. I use the data type Animal </p>
  
  <pre><code>@GET
  @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
  public Response showAnimalInfo(Animal animal){....}
  </code></pre>
  
  <p>It turns out that when the parameter string that is to be converted to Animal throws the CannotConvertAnimalException my custome exception mapper does not handle it. It goes on to throw ParamException.QueryParamException instead and gives it to my QueryParamException handler to handle the response. </p>
  
  <p>Do you guys have any idea how to make it so that when the conversion goes bad, and when the CannotConvertAnimalException gets thrown, the correct mapper handles it?</p>