title: Jersey: Returning 400 error instead of 500 when given invalid request body
body: <p>I'm using Jersey's integrated Jackson processing to transform incoming JSON to a POJO, e.g.:</p>
  
  <pre><code>@POST
  @Consumes(MediaType.APPLICATION_JSON)
  public Response newCustomer( CustomerRepresentation customer)
  {
  ...
  }
  </code></pre>
  
  <p>If a client sends JSON with invalid fields Jersey currently returns a <code>500 Internal Server Error</code>.  Instead, I'd like to return a <code>400 Bad Request</code>, preferably with some meaningful detail indicating which fields are in error.</p>
  
  <p>Any insight into how this could be accomplished?  (At least returning a generic 400 instead of the completely inappropriate 500?)</p>
  
  <p><strong>Update:</strong>
  Here's the exception being generated server-side, before my handler is invoked:</p>
  
  <pre><code>javax.servlet.ServletException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: 
  Unrecognized field "this_isnt_a_known"_field" (Class com.redacted....), not marked as ignorable
  </code></pre>