javax.mail
public class: MessagingException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.mail.MessagingException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MessageRemovedException, SearchException, SendFailedException, MethodNotSupportedException, AddressException, StoreClosedException, AuthenticationFailedException, ReadOnlyFolderException, FolderNotFoundException, FolderClosedException, NoSuchProviderException, IllegalWriteException, ParseException
The base class for all exceptions thrown by the Messaging classes
- author:
John - Mani
- author:
Bill - Shannon
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from javax.mail.MessagingException Detail: |
public synchronized Throwable getCause() {
return next;
}
Overrides the getCause method of Throwable
to return the next exception in the chain of nested exceptions. |
public synchronized Exception getNextException() {
return next;
}
Get the next exception chained to this one. If the
next exception is a MessagingException, the chain
may extend further. |
public synchronized boolean setNextException(Exception ex) {
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;
}
Add an exception to the end of the chain. If the end
is not a MessagingException, this
exception cannot be added to the end. |
public synchronized String toString() {
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();
}
Override toString method to provide information on
nested exceptions. |