title: Exception in Spring AOP Itself not getting handled through RestControllerAdvice
body: <p>I need to validate the HttpServletRequest for certain attribtues in my service layer before proceeding.  I created @Before advice, Please note that AOP method throws Exception. I want exception thrown by this method should be handled by RestControllerAdvice. I can see that AOP method is being executed but DataNotValidException is not being handled by RestControllerAdvice. RestConrollerAdvice is working fine if there is any exception on the validation of other parameters or any exception in RestController. </p>
  
  <pre><code>@Before("execution(* com.mycom.service.app.myappName.handler*.*.*(..)) &amp;&amp; args(httpServletRequest,..)" )
  public void validateRequest(JoinPoint joinPoint, HttpServletRequest httpServletRequest) throws DataNotValidException {
  </code></pre>
  
  <p>This is my @RestControllerAdvice. I tried to override handleExceptionInternal as well.</p>
  
  <p>public String handleLinkage(final HttpServletRequest httpServletRequest, @Valid UserLinkRequest userLinkReqeust, final HttpHeaders httpHeaders) {</p>
  
  <pre><code>    @RestControllerAdvice
      @Slf4j
      public class RestResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
  
          @ExceptionHandler(value = { InvalidFormatException.class, DataNotValidException.class, Exception.class,
                  SQLException.class })
          private ResponseEntity&lt;ResponseObjectData&gt; handleAllException(Exception exception, HttpHeaders headers,
                  WebRequest request, HandlerMethod handlerMethod) {
             // logErrorNBuildResponse
          }
      @Override
      protected ResponseEntity&lt;Object&gt; handleExceptionInternal(
              Exception ex, @Nullable Object body, HttpHeaders headers, HttpStatus status, WebRequest request) {
          // logErrorNBuildResponse
       } }
  </code></pre>