public class ExceptionUtil extends Object
Constructor and Description |
---|
ExceptionUtil() |
Modifier and Type | Method and Description |
---|---|
static Throwable |
baseException(Throwable t)
Get to the base exception (if any)
|
static String |
exceptionToString(Throwable t)
Utility method for converting an exception into a string.
|
static String |
getCallAt(Throwable t,
int nth)
Return the "nth" method call from the stack trace of "t", where 0 is
the top.
|
static String |
getStackTraceLines(Throwable t,
int numLines)
return the top n lines of this stack trace
Example: ExceptionUtil.getStackTraceLines(exception, 10);
|
static String |
getStackTraceUpTo(Throwable t,
String prefix)
return the stack trace up to the first line that starts with prefix
Example: ExceptionUtil.getStackTraceUpTo(exception, "jrunx
|
protected static void |
printExceptionStack(Throwable th,
PrintWriter out,
int depth)
Recursively prints out a stack of wrapped exceptions.
|
static String |
toString(Throwable t)
return the stack trace in a String
|
static Throwable |
wrappedException(Throwable t) |
public static String getStackTraceUpTo(Throwable t, String prefix)
public static String getStackTraceLines(Throwable t, int numLines)
public static String getCallAt(Throwable t, int nth)
public static String exceptionToString(Throwable t)
t
- The throwable exceptionprotected static void printExceptionStack(Throwable th, PrintWriter out, int depth)
Copyright © 2016 The Apache Software Foundation. All rights reserved.