title: PK string returns in Spring response
body: <p>I am trying to return custom error message by using @ExceptionHandler but I receive extra junk value of PK in the response. I have attached the screen shot as well as code here in for any suggestion.</p>
  <p>Anyone can suggest here?</p>
  <p>Java Code:</p>
  <pre><code>@ExceptionHandler(value = InvalidMediaPKException.class)
  public ResponseEntity&lt;MediaErrorWsDTO&gt; handleInvalidMediaPKException(final InvalidMediaPKException exception)
  {
      final MediaErrorWsDTO errors = new MediaErrorWsDTO();
      errors.setCode(HttpStatus.NOT_FOUND.toString());
      errors.setMessage(String.format(INVALID_MEDIA_ERROR_MSG));
      return new ResponseEntity&lt;MediaErrorWsDTO&gt;(errors, HttpStatus.NOT_FOUND);
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/iLtdR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iLtdR.png" alt="enter image description here" /></a></p>