public class StackTraceUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
STACK_LOG_NAME |
Constructor and Description |
---|
StackTraceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addClassTest(Closure test)
Adds a groovy.lang.Closure to test whether the stack trace
element should be added or not.
|
static Throwable |
deepSanitize(Throwable t)
Sanitize the exception and ALL nested causes
|
static Throwable |
extractRootCause(Throwable t)
Extracts the root cause of the exception, no matter how nested it is
|
static boolean |
isApplicationClass(String className) |
static void |
printSanitizedStackTrace(Throwable t) |
static void |
printSanitizedStackTrace(Throwable t,
PrintWriter p) |
static Throwable |
sanitize(Throwable t)
Remove all apparently groovy-internal trace entries from the exception instance
|
static Throwable |
sanitizeRootCause(Throwable t)
Get the root cause of an exception and sanitize it for display to the user
|
public static final String STACK_LOG_NAME
public static void addClassTest(Closure test)
The groovy.lang.Closure will be given the class name as parameter. the return value decides if the element will be added or not.
test
- the testing groovy.lang.Closurepublic static Throwable sanitize(Throwable t)
This modifies the original instance and returns it, it does not clone
t
- the Throwable whose stack trace we want to sanitizepublic static void printSanitizedStackTrace(Throwable t, PrintWriter p)
public static void printSanitizedStackTrace(Throwable t)
public static boolean isApplicationClass(String className)
public static Throwable extractRootCause(Throwable t)
t
- a Throwablepublic static Throwable sanitizeRootCause(Throwable t)
This will MODIFY the stacktrace of the root cause exception object and return it
t
- a throwablepublic static Throwable deepSanitize(Throwable t)
This will MODIFY the stacktrace of the exception instance and all its causes irreversibly
t
- a throwable