- Simplify the code.
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 15 Jan 2007 15:41:36 +0000 (15:41 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 15 Jan 2007 15:41:36 +0000 (15:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@496373 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/valves/ErrorReportValve.java

index 793bc13..45780d9 100644 (file)
@@ -163,15 +163,6 @@ public class ErrorReportValve
         if ((statusCode < 400) || (response.getContentCount() > 0))
             return;
 
-        Throwable rootCause = null;
-
-        if (throwable != null) {
-
-            if (throwable instanceof ServletException)
-                rootCause = ((ServletException) throwable).getRootCause();
-
-        }
-
         String message = RequestUtil.filter(response.getMessage());
         if (message == null)
             message = "";
@@ -227,6 +218,7 @@ public class ErrorReportValve
             sb.append("</pre></p>");
 
             int loops = 0;
+            Throwable rootCause = throwable.getCause();
             while (rootCause != null && (loops < 10)) {
                 stackTrace = getPartialServletStackTrace(rootCause);
                 sb.append("<p><b>");