@@ -136,18 +136,18 @@ private void handleException(HttpServletRequest request,
136
136
request .setAttribute (ERROR_EXCEPTION , ex );
137
137
request .setAttribute (ERROR_EXCEPTION_TYPE , type .getName ());
138
138
wrapped .sendError (500 , ex .getMessage ());
139
- forwardToErrorPage (errorPath , request , wrapped );
139
+ forwardToErrorPage (errorPath , request , wrapped , ex );
140
140
}
141
141
142
142
private void forwardToErrorPage (String path , HttpServletRequest request ,
143
- ServletResponse response ) throws ServletException , IOException {
143
+ ServletResponse response , Throwable ex ) throws ServletException , IOException {
144
144
if (!response .isCommitted ()) {
145
145
String message = "Cannot forward to error page for" + request .getRequestURI ()
146
146
+ " (response is committed), so this response may have "
147
147
+ "the wrong status code" ;
148
- // User might see the error page without all the data here but the exception
149
- // isn't going to help anyone (and it's already been logged )
150
- logger .error (message );
148
+ // User might see the error page without all the data here but throwing the
149
+ // exception isn't going to help anyone (we'll log it to be on the safe side )
150
+ logger .error (message , ex );
151
151
return ;
152
152
}
153
153
response .reset ();
0 commit comments