From 96bfc14dba7691f0f8cd893ac90b39e09ac8ae1a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 22 Nov 2016 16:00:23 +0100 Subject: [PATCH] No warn logging for propagated original exception Issue: SPR-14907 --- .../method/annotation/ExceptionHandlerExceptionResolver.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java index 2ee4addf6b..c8f7a15974 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java @@ -381,9 +381,12 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce } } catch (Throwable invocationEx) { - if (logger.isWarnEnabled()) { + // Any other than the original exception is unintended here, + // probably an accident (e.g. failed assertion or the like). + if (invocationEx != exception && logger.isWarnEnabled()) { logger.warn("Failed to invoke @ExceptionHandler method: " + exceptionHandlerMethod, invocationEx); } + // Continue with default processing of the original exception... return null; }