Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51550
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 2 Sep 2011 11:26:14 +0000 (11:26 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 2 Sep 2011 11:26:14 +0000 (11:26 +0000)
Use context error pages where possible e.g. for authenticator errors

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1164480 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/StandardHostValve.java

index d1bfb84..80a8217 100644 (file)
@@ -164,7 +164,13 @@ final class StandardHostValve extends ValveBase {
         if (asyncAtStart || context.fireRequestInitEvent(request)) {
 
             // Ask this Context to process this request
-            context.getPipeline().getFirst().invoke(request, response);
+            try {
+                context.getPipeline().getFirst().invoke(request, response);
+            } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
+                request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
+                throwable(request, response, t);
+            }
     
             // If the request was async at the start and an error occurred then
             // the async error handling will kick-in and that will fire the