@@ -136,18 +136,18 @@ private void handleException(HttpServletRequest request,
136136 request .setAttribute (ERROR_EXCEPTION , ex );
137137 request .setAttribute (ERROR_EXCEPTION_TYPE , type .getName ());
138138 wrapped .sendError (500 , ex .getMessage ());
139- forwardToErrorPage (errorPath , request , wrapped );
139+ forwardToErrorPage (errorPath , request , wrapped , ex );
140140 }
141141
142142 private void forwardToErrorPage (String path , HttpServletRequest request ,
143- ServletResponse response ) throws ServletException , IOException {
143+ ServletResponse response , Throwable ex ) throws ServletException , IOException {
144144 if (!response .isCommitted ()) {
145145 String message = "Cannot forward to error page for" + request .getRequestURI ()
146146 + " (response is committed), so this response may have "
147147 + "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 );
151151 return ;
152152 }
153153 response .reset ();
0 commit comments