Defensive catching of any Throwable subclasses instead of just Error

Issue: SPR-14329
This commit is contained in:
Juergen Hoeller
2016-06-04 00:17:20 +02:00
parent f657952cee
commit a9fda3e7e2
5 changed files with 11 additions and 11 deletions

View File

@@ -972,7 +972,7 @@ public class DispatcherServlet extends FrameworkServlet {
catch (Exception ex) {
dispatchException = ex;
}
catch (Error err) {
catch (Throwable err) {
// As of 4.3, we're processing Errors thrown from handler methods as well,
// making them available for @ExceptionHandler methods and other scenarios.
dispatchException = new NestedServletException("Handler dispatch failed", err);
@@ -982,7 +982,7 @@ public class DispatcherServlet extends FrameworkServlet {
catch (Exception ex) {
triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
}
catch (Error err) {
catch (Throwable err) {
triggerAfterCompletion(processedRequest, response, mappedHandler,
new NestedServletException("Handler processing failed", err));
}