Author: markt
Date: Mon Jun 11 09:25:50 2012
New Revision: 1348763

URL: http://svn.apache.org/viewvc?rev=1348763&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53071
Stepping through the code, light dawns as to what the bug report was getting at.
Use the message from the Throwable for the error report if none was specified 
via sendError()

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
    
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestErrorReportValve.java

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1348762

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1348763&r1=1348762&r2=1348763&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
Mon Jun 11 09:25:50 2012
@@ -165,7 +165,11 @@ public class ErrorReportValve extends Va
 
         String message = RequestUtil.filter(response.getMessage());
         if (message == null) {
-            message = "";
+            if (throwable != null) {
+                message = RequestUtil.filter(throwable.getMessage());
+            } else {
+                message = "";
+            }
         }
 
         // Do nothing if there is no report for the specified status code

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestErrorReportValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestErrorReportValve.java?rev=1348763&r1=1348762&r2=1348763&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestErrorReportValve.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TestErrorReportValve.java 
Mon Jun 11 09:25:50 2012
@@ -49,7 +49,8 @@ public class TestErrorReportValve extend
 
         ByteChunk res = getUrl("http://localhost:"; + getPort());
 
-        Assert.assertTrue(res.toString().contains(ErrorServlet.ERROR_TEXT));
+        Assert.assertTrue(res.toString().contains("<p><b>message</b> <u>" +
+                ErrorServlet.ERROR_TEXT + "</u></p>"));
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to