cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r1464034 - /cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
Date Wed, 03 Apr 2013 14:13:03 GMT
Author: thorsten
Date: Wed Apr  3 14:13:03 2013
New Revision: 1464034

URL: http://svn.apache.org/r1464034
Log:
Adding cause for getting better detail for nested exceptions

Modified:
    cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java?rev=1464034&r1=1464033&r2=1464034&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
(original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/component/ExceptionGenerator.java
Wed Apr  3 14:13:03 2013
@@ -77,6 +77,17 @@ public class ExceptionGenerator extends 
         attr.clear();
         simpleElement("message", attr, throwable.getMessage(), handler);
 
+        if (null != throwable.getCause()) {
+            // cause
+            attr.clear();
+            simpleElement("cause", attr, throwable.getCause().getMessage(),
+                    handler);
+            StringWriter swCause = new StringWriter();
+            PrintWriter pwCause = new PrintWriter(swCause, true);
+            throwable.getCause().printStackTrace(pwCause);
+            simpleElement("stacktraceCause", attr, swCause.getBuffer().toString(), handler);
+        }
+
         // exception stacktrace
         attr.clear();
         StringWriter sw = new StringWriter();



Mime
View raw message