|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Error
com.arsdigita.util.WrappedError
A wrapper error that can be used to rethrow another throwable. TODO: This should become a skeleton when/if we switch to Java 1.4. http://java.sun.com/j2se/1.4/docs/guide/lang/chained-exceptions.html The basic exception methods are overridden with methods that combine this wrapper and its root cause, so it can be treated just like any normal exception in actual use.
Field Summary | |
static String |
versionId
|
Constructor Summary | |
WrappedError(String msg)
Constructor which only takes a msg, which will cause this WrappedError to behave like a normal RuntimeException. |
|
WrappedError(String s,
Throwable rootCause)
Constructor which takes a message string and a root cause that this exception will be wrapping. |
|
WrappedError(Throwable rootCause)
Constructor which takes a root cause that this exception will be wrapping. |
Method Summary | |
String |
getMessage()
This exception's message and the root cause's. |
Throwable |
getRootCause()
Gets the root cause of this exception. |
boolean |
hasRootCause()
Indicates if this exception has a root cause. |
void |
printStackTrace()
Stack trace for the root cause. |
void |
printStackTrace(PrintStream s)
Stack trace for the root cause. |
void |
printStackTrace(PrintWriter s)
Stack trace for the root cause. |
static void |
throwLoggedException(Class source,
String msg,
Throwable rootCause)
Throws an WrappedError, and ensurs that it is logged at ERROR priority. |
String |
toString()
Get a string representing this exception and the root cause. |
String |
toString(Class delegatingClass)
Get a string representing this exception and the root cause. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public WrappedError(String msg)
public WrappedError(Throwable rootCause)
public WrappedError(String s, Throwable rootCause)
Method Detail |
public static void throwLoggedException(Class source, String msg, Throwable rootCause) throws WrappedError
source
- Class having the error. For Log4J reportingmsg
- Error messagerootCause
- The root cause exception
WrappedError
public boolean hasRootCause()
public Throwable getRootCause()
public String toString()
public String toString(Class delegatingClass)
public String getMessage()
public void printStackTrace()
public void printStackTrace(PrintStream s)
public void printStackTrace(PrintWriter s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |