|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.arsdigita.util.UncheckedWrapperException
A wrapper exception that can be used to rethrow another exception. 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. Note that it is not necessary to provide a string along with a root cause; in particular, the following usage: new UncheckedWrapperException(e); is more correct than new UncheckedWrapperException(e.getMessage(), e);
Field Summary | |
static String |
versionId
|
Constructor Summary | |
UncheckedWrapperException(String msg)
Constructor which only takes a msg, which will cause this UncheckedWrapperException to behave like a normal RuntimeException. |
|
UncheckedWrapperException(String s,
Throwable rootCause)
Constructor which takes a message string and a root cause that this exception will be wrapping. |
|
UncheckedWrapperException(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 UncheckedWrapperException, 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 UncheckedWrapperException(String msg)
public UncheckedWrapperException(Throwable rootCause)
public UncheckedWrapperException(String s, Throwable rootCause)
Method Detail |
public static void throwLoggedException(Class source, String msg, Throwable rootCause) throws UncheckedWrapperException
source
- Class having the error. For Log4J reportingmsg
- Error messagerootCause
- The root cause exception
UncheckedWrapperException
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 |