You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Robert Cauble <rc...@motive.com> on 2002/10/25 20:55:54 UTC

No way to get original exception from AxisFault

If I have a service which throws an exception that doesn't extend AxisFault, the exception is wrapped as an AxisFault, but there doesn't seem to be any way to get the original exception. 

I noticed that there is an element "exceptionName" in the fault-details, but that is only set if the exception is a subclass of AxisFault, as you can see from the piece of code in AxisFault.initFromException:

...
if ((target instanceof AxisFault) &&
    (target.getClass() != AxisFault.class)) {
   el = XMLUtils.StringToElement(Constants.NS_URI_AXIS, 
                                 "exceptionName", 
                                 target.getClass().getName());
            
   faultDetails.add(el);        
}
...

Are there plans to add a "getRootException" method to AxisFault which returns the root exception? 

Any help would be appreciated.

Thanks,
Rob

Re: No way to get original exception from AxisFault

Posted by Steve Loughran <st...@iseran.com>.
It might make sense, as I am thinking of cleaning up fault handling so the
fault body *never* contains a stack trace of a nested fault, to stop stack
traces going down the wire in production boxes. We still need access to
contained faults when appropriate...




----- Original Message -----
From: "Robert Cauble" <rc...@motive.com>
To: <xm...@apache.org>
Sent: Friday, October 25, 2002 11:55 AM
Subject: No way to get original exception from AxisFault


If I have a service which throws an exception that doesn't extend AxisFault,
the exception is wrapped as an AxisFault, but there doesn't seem to be any
way to get the original exception.

I noticed that there is an element "exceptionName" in the fault-details, but
that is only set if the exception is a subclass of AxisFault, as you can see
from the piece of code in AxisFault.initFromException:

...
if ((target instanceof AxisFault) &&
    (target.getClass() != AxisFault.class)) {
   el = XMLUtils.StringToElement(Constants.NS_URI_AXIS,
                                 "exceptionName",
                                 target.getClass().getName());

   faultDetails.add(el);
}
...

Are there plans to add a "getRootException" method to AxisFault which
returns the root exception?

Any help would be appreciated.

Thanks,
Rob