From: markt Date: Fri, 2 Sep 2011 11:26:14 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51550 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9d25b28c35f99d34c8ebd655b3b79c5b99a4206d;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51550 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 --- diff --git a/java/org/apache/catalina/core/StandardHostValve.java b/java/org/apache/catalina/core/StandardHostValve.java index d1bfb8491..80a8217a4 100644 --- a/java/org/apache/catalina/core/StandardHostValve.java +++ b/java/org/apache/catalina/core/StandardHostValve.java @@ -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