|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.codehaus.spice.salt.lang.ExceptionUtil
This class makes it easy to manipulate data stored in exceptions.
Field Summary | |
static String |
SEPARATOR
Constant that used to separate causes when recursively printing exceptions. |
Constructor Summary | |
ExceptionUtil()
|
Method Summary | |
static String[] |
captureStackTrace(Throwable throwable)
Captures the stack trace associated with this exception. |
static String[] |
captureStackTrace(Throwable throwable,
String stopLine)
Captures the stack trace associated with this exception. |
static Throwable |
getCause(Throwable throwable)
Utility method to get cause of exception. |
static Throwable |
getRootCause(Throwable throwable)
Utility method to get thr root cause of an exception. |
static String |
prettyPrintStackTrace(Throwable throwable,
String stopLine)
Pretty print the stack trace. |
static String |
printStackTrace(Throwable throwable)
Generate string for specified exception and the cause of this exception (if any). |
static String |
printStackTrace(Throwable throwable,
boolean printCause)
Generate string for specified exception and if printCause is true will print all exception that caused this exception (if any). |
static String |
printStackTrace(Throwable throwable,
int depth,
boolean printCause)
Generate exception string for specified exception with specified number of lines including causes if printCause is true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String SEPARATOR
Constructor Detail |
public ExceptionUtil()
Method Detail |
public static String printStackTrace(Throwable throwable)
throwable
- a Throwable
String
public static String printStackTrace(Throwable throwable, boolean printCause)
throwable
- a Throwable
printCause
- if true
will print exceptions cause
String
public static String printStackTrace(Throwable throwable, int depth, boolean printCause)
throwable
- a Throwable
depth
- number of stack trace frames to showprintCause
- if true
will print the causes of all
exceptions
String
public static String prettyPrintStackTrace(Throwable throwable, String stopLine)
throwable
- the exceptionstopLine
- the stop linepublic static Throwable getRootCause(Throwable throwable)
throwable
- a Throwable
public static Throwable getCause(Throwable throwable)
throwable
- a Throwable
public static String[] captureStackTrace(Throwable throwable)
throwable
- a Throwable
public static String[] captureStackTrace(Throwable throwable, String stopLine)
throwable
- a Throwable
stopLine
- the stopLine
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |