servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r726072 - /servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java
Date Fri, 12 Dec 2008 17:13:41 GMT
Author: gnodet
Date: Fri Dec 12 09:13:39 2008
New Revision: 726072

URL: http://svn.apache.org/viewvc?rev=726072&view=rev
Log:
SMX4NMR-57: Exchange.toString() does not display exceptions

Modified:
    servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java

Modified: servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java?rev=726072&r1=726071&r2=726072&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java
(original)
+++ servicemix/smx4/nmr/trunk/nmr/core/src/main/java/org/apache/servicemix/nmr/core/util/ExchangeUtils.java
Fri Dec 12 09:13:39 2008
@@ -23,6 +23,7 @@
 import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.io.PrintWriter;
 
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.dom.DOMResult;
@@ -70,6 +71,13 @@
         display(exchange, Type.In, sb);
         display(exchange, Type.Out, sb);
         display(exchange, Type.Fault, sb);
+        if (exchange.getError() != null) {
+            sb.append("  error: [").append('\n');
+            StringWriter sw = new StringWriter();
+            exchange.getError().printStackTrace(new PrintWriter(sw));
+            sb.append("    ").append(sw.toString().replace("\n", "\n    ").replace("\t",
"  ").trim()).append('\n');
+            sb.append("  ]").append('\n');
+        }
         sb.append("]\n");
         return sb.toString();
     }



Mime
View raw message