Skip to content

Doc: ControllerAdvice @ExceptionHandler matching for root vs cause in multi-advice scenario [SPR-16074] #20623

Closed
@spring-projects-issues

Description

@spring-projects-issues

Franz Wong opened SPR-16074 and commented

I have ExceptionA and ExceptionB.

ExceptionB is the cause of ExceptionA.

ExceptionB exceptionB = new ExceptionB();
throw new ExceptionA(exceptionB);

The order of exception handlers for both exceptions are the same.
It means ExceptionBHandler "may" be checked before ExceptionAHandler in "ExceptionHandlerExceptionResolver.getExceptionHandlerMethod", thus it uses ExceptionBHandler instead of ExceptionAHandler.


Affects: 4.3.10

Referenced from: commits ea00c7c, d473506

Backported to: 4.3.13

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions