public class ExceptionUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ExceptionUtils.CustomStackTrace
Interface allowing
Throwable specializations to provide their custom stack trace presentation. |
Constructor and Description |
---|
ExceptionUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
dumpStack(PrintStream out) |
static void |
dumpStack(PrintStream out,
int skip,
int depth) |
static void |
dumpStack(PrintStream out,
StackTraceElement[] stack,
int skip,
int depth) |
static void |
dumpStack(PrintStream out,
Throwable t,
int skip,
int depth) |
static void |
dumpThrowable(String additionalDescr,
Throwable t)
Dumps a
Throwable to System.err in a decorating message including the current thread name,
and its stack trace . |
static void |
dumpThrowable(String additionalDescr,
Throwable t,
int causeDepth,
int stackDepth)
Dumps a
Throwable to System.err in a decorating message including the current thread name,
and its stack trace . |
static int |
printCause(PrintStream s,
String causeStr,
Throwable cause,
int causeIdx,
int causeDepth,
int stackDepth)
|
static void |
printStackTrace(PrintStream s,
Throwable t,
int causeDepth,
int stackDepth)
|
public static void dumpStack(PrintStream out)
public static void dumpStack(PrintStream out, int skip, int depth)
public static void dumpStack(PrintStream out, Throwable t, int skip, int depth)
public static void dumpStack(PrintStream out, StackTraceElement[] stack, int skip, int depth)
public static int printCause(PrintStream s, String causeStr, Throwable cause, int causeIdx, int causeDepth, int stackDepth)
s
- output streamcauseStr
- the cause titlecause
- the Throwable
cause for outputcauseIdx
- the cause index over all causes known by callercauseDepth
- the maximum depth for causes, or -1
for allstackDepth
- the maximum depth for stack entries, or -1
for allpublic static void printStackTrace(PrintStream s, Throwable t, int causeDepth, int stackDepth)
s
- output streamt
- the Throwable
for outputcauseDepth
- the maximum depth for causes, or -1
for allstackDepth
- the maximum depth for stack entries, or -1
for allpublic static void dumpThrowable(String additionalDescr, Throwable t)
Throwable
to System.err
in a decorating message including the current thread name,
and its stack trace
.
Implementation will iterate through all causes
.
public static void dumpThrowable(String additionalDescr, Throwable t, int causeDepth, int stackDepth)
Throwable
to System.err
in a decorating message including the current thread name,
and its stack trace
.
Implementation will iterate through all causes
.