title: Spring Custom Exception hanlding
body: <pre class="lang-java prettyprint-override"><code>   @ExceptionHandler(RecordAlreadyExistException.class)
          public final ResponseEntity&lt;Object&gt; handleAlreadyExistRecordException(
              RecordAlreadyExistException ex, WebRequest request) {
  
              List&lt;String&gt; details = new ArrayList&lt;&gt;();
              details.add(ex.getLocalizedMessage());
              ErrorResponse errorDetails = new ErrorResponse(
                "Already registered user ? Did you forget your password ? Please contact anemail@gmail.com for all queries", details);
              return new ResponseEntity(errorDetails, HttpStatus.NOT_FOUND);
          }
  </code></pre>
  
  <p>Here is my scenario:
  When the user already exists,
  it should throw this custom exception.
  I get the response code,
  but not the body
  (i.e. the error details I passed in the response entity are
  not displayed in the browser).</p>
  
  <p>Any idea?</p>