title: Can a generic @ExceptionHandler and DefaultHandlerExceptionResolver play nice?
body: <p>I'd like to implement an <code>@ExceptionHandler</code> that prevents all uncaught exceptions from getting to the client. Something like this...</p>
  
  <pre><code>@ControllerAdvice
  public class ExceptionHandlingControllerAdvice {
  
      private static final Logger logger = getLogger(ExceptionHandlingControllerAdvice.class);
  
      @ExceptionHandler(Exception.class)
      @ResponseStatus(value = INTERNAL_SERVER_ERROR)
      public void handleAnyUncaughtException(Exception e) {
          logger.error("This uncaught exception is being blocked from reaching the client.", e);
      }
  }
  </code></pre>
  
  <p>But this is getting in the way of the exception handling performed out of the box by <code>DefaultHandlerExceptionResolver</code>, e.g. to throw 4xx errors on failed <code>@RequestBody</code> validations checked with <code>@Valid</code>. It seems like <code>@ExceptionHandler</code> is taking precedence and returning 500 before the <code>DHER</code> can try to return a 4xx.</p>
  
  <p>Is there a way to block uncaught exceptions from getting to the client, but still let the <code>DefaultHandlerExceptionResolver</code> do its job?</p>