openamf/src/java/org/openamf/invoker ServiceInvocationException.java,1.4,1.5
| Newsgroups | gmane.comp.java.openamf.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openamf/openamf/src/java/org/openamf/invoker
In directory sc8-pr-cvs1:/tmp/cvs-serv31910/src/java/org/openamf/invoker
Modified Files:
ServiceInvocationException.java
Log Message:
added getRootCause now a more helpful stack trace is returned to flash
Index: ServiceInvocationException.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/ServiceInvocationException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ServiceInvocationException.java 22 Apr 2003 01:44:06 -0000 1.4
--- ServiceInvocationException.java 8 May 2003 22:58:05 -0000 1.5
***************
*** 34,38 ****
AMFError amfError = new AMFError();
! StackTraceElement[] stackTrace = cause.getStackTrace();
StringBuffer stackTraceBuffer = new StringBuffer();
for (int i = 0; i < stackTrace.length; i++) {
--- 34,39 ----
AMFError amfError = new AMFError();
! Throwable rootCause = getRootCause(cause);
! StackTraceElement[] stackTrace = rootCause.getStackTrace();
StringBuffer stackTraceBuffer = new StringBuffer();
for (int i = 0; i < stackTrace.length; i++) {
***************
*** 47,50 ****
--- 48,61 ----
return amfError;
+
+ }
+
+ private Throwable getRootCause(Throwable cause) {
+
+ if (cause.getCause() == null) {
+ return cause;
+ } else {
+ return getRootCause(cause.getCause());
+ }
}
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com