novie-core/src/main/java/com/groupon/novie/internal/controllers/ApiController.java
@ExceptionHandler(ServiceException.class)
    @ResponseBody
    public ResponseEntity<String> handleServiceException(ServiceException exception) {
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.TEXT_PLAIN);
        return new ResponseEntity<String>(exception.getMessage(), headers, HttpStatus.INTERNAL_SERVER_ERROR);
    }
@ExceptionHandler(ServiceException.class)
    @ResponseBody
    public ResponseEntity<String> handleServiceException(ServiceException exception) {
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.TEXT_PLAIN);
        return new ResponseEntity<String>(exception.getMessage(), headers, HttpStatus.INTERNAL_SERVER_ERROR);
    }
@ ExceptionHandler ( ServiceException . class ) @ ResponseBody public ResponseEntity < String > handleServiceException ( ServiceException exception ) { HttpHeaders headers = new HttpHeaders ( ) ; headers . setContentType ( MediaType . TEXT_PLAIN ) ; return new ResponseEntity < String > ( exception . getMessage ( ) , headers , HttpStatus . INTERNAL_SERVER_ERROR ) ; }
<p>
Handles {@link ServiceException} generated by the underlying layer.
</p>

@param exception of type {@link ServiceException}

@return A {@link ResponseEntity} with the {@link HttpStatus#INTERNAL_SERVER_ERROR}
code and a message describing the error itself.
<p > Handles { @link ServiceException } generated by the underlying layer . < / p >