title: @ExceptionHandler for type Exception not called for Spring exception in custom ResponseEntityExceptionHandler
body: <p>After reading some blog posts about making a custom exception handler for Spring, I wrote the following class:</p>
  
  <pre><code>@ControllerAdvice
  public class RestExceptionHandler extends ResponseEntityExceptionHandler {
      @ExceptionHandler(value = Exception.class)
      @ResponseBody
      public ResponseEntity&lt;Object&gt; exceptionHandler(Exception e) {
          HashMap&lt;String, Object&gt; msg = new HashMap&lt;&gt;(2);
          msg.put("error", HttpStatus.PRECONDITION_FAILED.value());
          msg.put("message", "Something went wrong");
          return new ResponseEntity&lt;&gt;(msg, HttpStatus.BAD_REQUEST);
      }
  }
  </code></pre>
  
  <p>The intent is to send <code>msg</code> in the JSON response instead of giving away the Spring exception what was thrown for whatever reason.</p>
  
  <p>This class isn't working, however.</p>
  
  <p>When I hit, say, and invalid endpoint for my server API, I get the default response payload:</p>
  
  <pre><code>{
    "timestamp": 1449238700342,
    "status": 405,
    "error": "Method Not Allowed",
    "exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
    "message": "Request method 'POST' not supported",
    "path": "/bad_enpoint"
  }
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>Thanks.</p>