I have a global exception handler to share across REST @Controllers. For this I use a @ControllerAdvice with some @ExceptionHandler methods. This works fine. Now, if I add an @ExceptionHandler in a particular Rest Controller then that new handler takes precedence over the global exception handler and the global one is just never called.
What I need is actually to have both called. The order doesn't matter. The point is that there is some global, controller-agnostic error handling code and also some controller-specific error handling and I need both to execute. Is this possible? e.g. Can I somehow in the controller-specific handler (which is called first) mark the exception handling as not handled so the next handler in line is invoked?
I know I could inject the @ControllerAdvice in the @Controller and invoke the global handler from the specific one myself, but I rather keep the controller decoupled from the global exception handler