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();
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.