title: why Spring throws HttpMessageNotReadableException with different CAUSES for JSON
body: <p>I have a exception handler controller where I am  catching  HttpMessageNotReadableException as below:</p>
  
  <pre><code>@ExceptionHandler(HttpMessageNotReadableException.class)
      @ResponseStatus(value = HttpStatus.BAD_REQUEST)
      @ResponseBody
      protected ErrorMessage handleJsonException(final HttpMessageNotReadableException ex, final HttpServletRequest request)
  {
      if (ex.getCause() instanceof JsonParseException)
      {
         // some code
      }
      if (ex .getCause() instanceof JsonMappingException)
      {
         // some code
      }
  }
  </code></pre>
  
  <p>i got different causes for POST and PUT with malformed json(the first double quotes is missing in JSON text) </p>
  
  <pre><code>{firstName":"abc","lastName":"xyz"}
  </code></pre>
  
  <p>POST - JsonParseException </p>
  
  <p>PUT - JsonMappingException</p>
  
  <p>I believe both should have the same cause "<strong>JsonParseException</strong>" as the syntax is wrong. </p>
  
  <p>Can anyone suggest why spring gives different for PUT as "<strong>JsonMappingException</strong>".</p>