Author: markt
Date: Sun Aug 12 15:39:24 2012
New Revision: 1372131

URL: http://svn.apache.org/viewvc?rev=1372131&view=rev
Log:
Additional fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=53071
Trim long exception messages

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1372131&r1=1372130&r2=1372131&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Sun Aug 
12 15:39:24 2012
@@ -19,6 +19,7 @@ package org.apache.catalina.valves;
 
 import java.io.IOException;
 import java.io.Writer;
+import java.util.Scanner;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
@@ -142,7 +143,11 @@ public class ErrorReportValve extends Va
         String message = RequestUtil.filter(response.getMessage());
         if (message == null) {
             if (throwable != null) {
-                message = RequestUtil.filter(throwable.getMessage());
+                String exceptionMessage = throwable.getMessage();
+                if (exceptionMessage != null && exceptionMessage.length() > 0) 
{
+                    message = RequestUtil.filter(
+                            (new Scanner(exceptionMessage)).nextLine());
+                }
             }
             if (message == null) {
                 message = "";



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to