Skip to content

Commit 157df86

Browse files
committed
Do not warn also if cause is re-thrown
Closes gh-23233
1 parent 37f9ce5 commit 157df86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,9 @@ protected ModelAndView doResolveHandlerMethodException(HttpServletRequest reques
407407
}
408408
}
409409
catch (Throwable invocationEx) {
410-
// Any other than the original exception is unintended here,
410+
// Any other than the original exception (or its cause) is unintended here,
411411
// probably an accident (e.g. failed assertion or the like).
412-
if (invocationEx != exception && logger.isWarnEnabled()) {
412+
if (invocationEx != exception && invocationEx != exception.getCause() && logger.isWarnEnabled()) {
413413
logger.warn("Failure in @ExceptionHandler " + exceptionHandlerMethod, invocationEx);
414414
}
415415
// Continue with default processing of the original exception...

0 commit comments

Comments
 (0)