Skip to content

Allow SimpleMappingExceptionResolver to navigate exception "cause" hierarchy [SPR-5053] #9728

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

5 votes, 9 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions