@ExceptionHandler({MalformedJsonException.class}) @ResponseBody @ResponseStatus(HttpStatus.BAD_REQUEST) public String handleException(final RuntimeException e){
  return convertErrorAsJson(e.getMessage());
}

@ ExceptionHandler ( { MalformedJsonException . class } ) @ ResponseBody @ ResponseStatus ( HttpStatus . BAD_REQUEST ) public String handleException ( final RuntimeException e ) { return convertErrorAsJson ( e . getMessage ( ) ) ; }
handles malformedjsonfoundexception , occurring when rest service encounters incorrect or malformed json document < p / >
