Skip to content

@ExceptionHandler to keep nesting beyond the first cause#23380

Closed
Syquel wants to merge 2 commits intospring-projects:masterfrom
Syquel:bugfix/spring-web-nested-exception-handling
Closed

@ExceptionHandler to keep nesting beyond the first cause#23380
Syquel wants to merge 2 commits intospring-projects:masterfrom
Syquel:bugfix/spring-web-nested-exception-handling

Conversation

@Syquel
Copy link

@Syquel Syquel commented Jul 29, 2019

spring-web exception handling considers only the first cause of an exception to determine the applicable @ExceptionHandler.
This patch makes the resolver search through the full exception hierarchy.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 29, 2019
@Syquel Syquel force-pushed the bugfix/spring-web-nested-exception-handling branch from 953e085 to 25415db Compare August 20, 2019 14:04
@rstoyanchev rstoyanchev changed the title Fix spring-web nested exception handling @ExceptionHandler to handle all nested cause exceptions Nov 8, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 8, 2019
@rstoyanchev rstoyanchev added this to the 5.3 M1 milestone Nov 8, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Nov 8, 2019

Tentatively scheduling for 5.3 M1 as furthering the changes from #18863.

@rstoyanchev
Copy link
Contributor

rstoyanchev commented May 11, 2020

Team Decision: The original support for only the first cause was to keep the resolution simpler as well out of caution (it was introduced in 4.3 with years of existing @ExceptionHandler). It didn't cause major issues and also trying to resolve causes one level at a time is still relatively simple, e.g. vs checking the entire chain. Another point is that given remote calls from a controller, how nested an exception is may well be outside an application's control. We'll go ahead with this in 5.3 M1.

@rstoyanchev rstoyanchev changed the title @ExceptionHandler to handle all nested cause exceptions @ExceptionHandler to keep nesting beyond the first cause May 11, 2020
rstoyanchev added a commit that referenced this pull request May 13, 2020
@rstoyanchev
Copy link
Contributor

This has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants