title: global exception handling for rest exposed spring-data
body: <p>Using spring-data-rest to expose repositories i want to overwrite the default exception handling.</p>
  
  <p>reading documentation it looks to me that the best wat would be using a @ControllerAdvice annotated class </p>
  
  <pre><code>@ControllerAdvice
  class GlobalControllerExceptionHandler extends ResponseEntityExceptionHandler {
  
      Logger log = LoggerFactory.getLogger(GlobalControllerExceptionHandler.class);
  
      @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
      @ExceptionHandler(Exception.class)
      public ResponseEntity&lt;Object&gt; badRequest(HttpServletRequest req, Exception exception) {
          log.info("++++ GLOBAL EXCEPTION HANDLING ++++");
          return null;
      }
  }
  </code></pre>
  
  <p>There are several point i am not sure about:</p>
  
  <ul>
  <li>Should i extend ResponseEntityExceptionHandler, other class, nothing?</li>
  <li>Should i return ResponseEntity object, other class?</li>
  </ul>
  
  <p>By the way this does not seems to work even when i've tried different configurations. Is there a way to customize error handling in spring-data-rest?</p>