/ spring-framework Public
Have ExceptionHandlerMethodResolver use most-specific ExceptionHandler method [SPR-11016] #15644
Issues in web modules (web, webmvc, webflux, websocket)
An outdated, unresolved issue that's closed in bulk as part of a cleaning process
Deejay opened SPR-11016 and commented
It'd be good to have exceptions handled by the
@ExceptionHandlerwith the most specific exception type defined. At the moment, it appears to be handled by whichever handler it finds first that can deal with any type in the exception's ancestry.
ExceptionMappermechanism iterates over each handler, then iterates up the type ancestry of the exception, counting as it goes. The handler with the shortest distance between the exception's actual type and the handled type wins and is returned. This could be cached for efficiency.
Reference URL: http://stackoverflow.com/questions/19498378/setting-precedence-of-multiple-controlleradvice-exceptionhandlers/19500823
The text was updated successfully, but these errors were encountered: