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.
Anyone can suggest here?
Java Code:
@ExceptionHandler(value = InvalidMediaPKException.class)
public ResponseEntity<MediaErrorWsDTO> 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<MediaErrorWsDTO>(errors, HttpStatus.NOT_FOUND);
}