Browse Source

Do not warn also if cause is re-thrown

Closes gh-23233
pull/23247/head
Rossen Stoyanchev 6 years ago
parent
commit
157df861f9
  1. 4
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ExceptionHandlerExceptionResolver.java

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

@ -407,9 +407,9 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce @@ -407,9 +407,9 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
}
}
catch (Throwable invocationEx) {
// Any other than the original exception is unintended here,
// Any other than the original exception (or its cause) is unintended here,
// probably an accident (e.g. failed assertion or the like).
if (invocationEx != exception && logger.isWarnEnabled()) {
if (invocationEx != exception && invocationEx != exception.getCause() && logger.isWarnEnabled()) {
logger.warn("Failure in @ExceptionHandler " + exceptionHandlerMethod, invocationEx);
}
// Continue with default processing of the original exception...

Loading…
Cancel
Save