Author: markt Date: Wed Aug 6 19:05:15 2014 New Revision: 1616307 URL: http://svn.apache.org/r1616307 Log: Code simplification & reformatting - no functional change
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=1616307&r1=1616306&r2=1616307&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Wed Aug 6 19:05:15 2014 @@ -110,8 +110,7 @@ final class StandardHostValve extends Va // Select the Context to be used for this Request Context context = request.getContext(); if (context == null) { - response.sendError - (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, sm.getString("standardHost.noContext")); return; } @@ -145,13 +144,13 @@ final class StandardHostValve extends Va } } + Throwable t = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); + // 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 // request destroyed event *after* the error handling has taken // place - if (!(request.isAsync() || (asyncAtStart && - request.getAttribute( - RequestDispatcher.ERROR_EXCEPTION) != null))) { + if (!(request.isAsync() || (asyncAtStart && t != null))) { // Protect against NPEs if context was destroyed during a // long running request. if (context.getState().isAvailable()) { @@ -159,9 +158,6 @@ final class StandardHostValve extends Va // Error page processing response.setSuspended(false); - Throwable t = (Throwable) request.getAttribute( - RequestDispatcher.ERROR_EXCEPTION); - if (t != null) { throwable(request, response, t); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org