Defensive catching of any Throwable subclasses instead of just Error

Issue: SPR-14329
Issue: SPR-14323
(cherry picked from commit a9fda3e)
This commit is contained in:
Juergen Hoeller
2016-06-04 00:17:20 +02:00
parent 2fd691b340
commit e219576414
5 changed files with 18 additions and 17 deletions

View File

@@ -975,7 +975,7 @@ public class DispatcherServlet extends FrameworkServlet {
catch (Exception ex) {
triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
}
catch (Error err) {
catch (Throwable err) {
triggerAfterCompletionWithError(processedRequest, response, mappedHandler, err);
}
finally {
@@ -1300,7 +1300,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
private void triggerAfterCompletionWithError(HttpServletRequest request, HttpServletResponse response,
HandlerExecutionChain mappedHandler, Error error) throws Exception {
HandlerExecutionChain mappedHandler, Throwable error) throws Exception {
ServletException ex = new NestedServletException("Handler processing failed", error);
if (mappedHandler != null) {