Description
Kenny MacLeod opened SPR-5053 and commented
In some cases, a business logic exception ends up being wrapped in some other exception by the time it gets to the HandlerExceptionResolver. This means that the likes of SimpleMappingExceptionResolver cannot easily handle it.
An example would be I have a FactoryBean which can throw a business logic exception during the creation of the object. The factory bean is in the context as a scoped proxy. When the proxy is dereferenced and the factorybean throws the business logic exception, the exception is wrapped in layers of spring BeanFactory exceptions as it rolls back up the AOP stack. This is fine, except I cannot then directly configure the original business logic exception in the SimpleMappingExceptionResolver.
If SimpleMappingExceptionResolver were able to walk up the tree of root cause exceptions (there may be JDK compatibility issues there), then it could peel the onion and handle the original exception accordingly.
Affects: 2.5.5
Issue Links:
- @ExceptionHandler should match cause as well (e.g. for exception thrown from argument formatter) [SPR-14291] #18863
@ExceptionHandler
should match cause as well (e.g. for exception thrown from argument formatter)
5 votes, 9 watchers