You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Patrick Taylor <ta...@pricingdynamics.com> on 2000/10/18 00:21:28 UTC

SOAPException.printStackTrace()

In debugging a problem with SOAP 2.0, I found that although
SOAPException can reference a targetException, it doesn't
redefine printStackTrace() to show the targetException's
stack.

Here's a patch:

--- SOAPException.java.orig     Tue Oct 17 17:08:34 2000
+++ SOAPException.java  Tue Oct 17 16:46:43 2000
@@ -113,6 +113,30 @@
     return msg;
   }
 
+  public void printStackTrace() {
+      super.printStackTrace();
+      if (targetException != null) {
+         System.err.println("CAUSE:");
+         targetException.printStackTrace();
+      }
+  }
+
+  public void printStackTrace(java.io.PrintStream ps) {
+      super.printStackTrace(ps);
+      if (targetException != null) {
+         ps.println("CAUSE:");
+         targetException.printStackTrace(ps);
+      }
+  }
+
+  public void printStackTrace(java.io.PrintWriter pw) {
+      super.printStackTrace(pw);
+      if (targetException != null) {
+         pw.println("CAUSE:");
+         targetException.printStackTrace(pw);
+      }
+  }
+
   public String toString () {
     return "[SOAPException: faultCode=" + faultCode + "; msg=" +
            super.getMessage () + ((targetException != null)