Skip to content

Commit f22a4a4

Browse files
committed
No warn logging for propagated original exception
Issue: SPR-14907 (cherry picked from commit 96bfc14)
1 parent b53ee13 commit f22a4a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,12 @@ protected ModelAndView doResolveHandlerMethodException(HttpServletRequest reques
382382
}
383383
}
384384
catch (Throwable invocationEx) {
385-
if (logger.isWarnEnabled()) {
385+
// Any other than the original exception is unintended here,
386+
// probably an accident (e.g. failed assertion or the like).
387+
if (invocationEx != exception && logger.isWarnEnabled()) {
386388
logger.warn("Failed to invoke @ExceptionHandler method: " + exceptionHandlerMethod, invocationEx);
387389
}
390+
// Continue with default processing of the original exception...
388391
return null;
389392
}
390393

0 commit comments

Comments
 (0)