Methods Summary |
---|
public synchronized java.lang.Throwable | getCause()Overrides the getCause method of Throwable
to return the next exception in the chain of nested exceptions.
return next;
|
public synchronized java.lang.Exception | getNextException()Get the next exception chained to this one. If the
next exception is a MessagingException, the chain
may extend further.
return next;
|
public synchronized boolean | setNextException(java.lang.Exception ex)Add an exception to the end of the chain. If the end
is not a MessagingException, this
exception cannot be added to the end.
Exception theEnd = this;
while (theEnd instanceof MessagingException &&
((MessagingException)theEnd).next != null) {
theEnd = ((MessagingException)theEnd).next;
}
// If the end is a MessagingException, we can add this
// exception to the chain.
if (theEnd instanceof MessagingException) {
((MessagingException)theEnd).next = ex;
return true;
} else
return false;
|
private final java.lang.String | superToString()Return the "toString" information for this exception,
without any information on nested exceptions.
return super.toString();
|
public synchronized java.lang.String | toString()Override toString method to provide information on
nested exceptions.
String s = super.toString();
Exception n = next;
if (n == null)
return s;
StringBuffer sb = new StringBuffer(s == null ? "" : s);
while (n != null) {
sb.append(";\n nested exception is:\n\t");
if (n instanceof MessagingException) {
MessagingException mex = (MessagingException)n;
sb.append(mex.superToString());
n = mex.next;
} else {
sb.append(n.toString());
n = null;
}
}
return sb.toString();
|