|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--java.lang.RuntimeException | +--org.jlf.log.AppError
The AppError
class is to be used for handling all exceptions
that need to be "bubbled" up to the user interface. When using try-catch on a
checked exception the AppError
class can be used to "wrap"
the original exception and provide a user friendly message for display. It is a
subclass of RuntimeException
so there is no need to handle it with a
try-catch block, thereby helping to streamline your code.
This class also supports automatic logging of the error, with a stack trace,
to the log of your choice.
Field Summary | |
protected java.lang.Throwable |
originalThrownObject
Holds a reference to the original Error or Exception object. |
Constructor Summary | |
AppError()
Empty constructor to create an AppError with no message. |
|
AppError(java.lang.String s)
Constructor accepting a message string. |
|
AppError(java.lang.String s,
java.lang.Throwable t)
Constructor accepting a message and a Throwable object. |
|
AppError(java.lang.String s,
java.lang.Throwable t,
Log log,
int loggingLevel)
Constructor accepting a message, a Throwable object, and logging information. |
|
AppError(java.lang.Throwable t)
Constructor accepting a reference to a Throwable object. |
Method Summary | |
java.lang.Throwable |
getOriginalThrownObject()
Returns the original thrown object. |
static java.lang.String |
getStackTraceAsString(java.lang.Throwable e)
Takes the Throwable given as input, generates a stack
trace, and converts it to a string to be returned. |
java.lang.String |
toString()
Returns a String representing the AppError information. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Throwable originalThrownObject
Constructor Detail |
public AppError()
AppError
with no message.
public AppError(java.lang.Throwable t)
AppError
to "wrap" a caught exception.
public AppError(java.lang.String s)
public AppError(java.lang.String s, java.lang.Throwable t)
AppError
to "wrap" a caught exception.
public AppError(java.lang.String s, java.lang.Throwable t, Log log, int loggingLevel)
Method Detail |
public static java.lang.String getStackTraceAsString(java.lang.Throwable e)
Throwable
given as input, generates a stack
trace, and converts it to a string to be returned.
public java.lang.Throwable getOriginalThrownObject()
AppError
is "wrapping" it.
public java.lang.String toString()
AppError
information.
toString
in class java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |