|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.StackTraceUtils
public class StackTraceUtils
Originally was grails.utils.GrailsUtils, removed some grails specific stuff. Utility methods removing internal lines from stack traces
Field Summary | |
---|---|
static java.lang.String |
STACK_LOG_NAME
|
Constructor Summary | |
---|---|
StackTraceUtils()
|
Method Summary | |
---|---|
static void |
addClassTest(Closure test)
Adds a groovy.lang.Closure to test whether the stack trace element should be added or not. |
static java.lang.Throwable |
deepSanitize(java.lang.Throwable t)
Sanitize the exception and ALL nested causes This will MODIFY the stacktrace of the exception instance and all its causes irreversibly |
static java.lang.Throwable |
extractRootCause(java.lang.Throwable t)
Extracts the root cause of the exception, no matter how nested it is |
static boolean |
isApplicationClass(java.lang.String className)
|
static void |
printSanitizedStackTrace(java.lang.Throwable t)
|
static void |
printSanitizedStackTrace(java.lang.Throwable t,
java.io.PrintWriter p)
|
static java.lang.Throwable |
sanitize(java.lang.Throwable t)
Remove all apparently groovy-internal trace entries from the exception instance This modifies the original instance and returns it, it does not clone |
static java.lang.Throwable |
sanitizeRootCause(java.lang.Throwable t)
Get the root cause of an exception and sanitize it for display to the user This will MODIFY the stacktrace of the root cause exception object and return it |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STACK_LOG_NAME
Constructor Detail |
---|
public StackTraceUtils()
Method Detail |
---|
public static void addClassTest(Closure test)
Adds a groovy.lang.Closure to test whether the stack trace element should be added or not.
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 java.lang.Throwable sanitize(java.lang.Throwable t)
Remove all apparently groovy-internal trace entries from the exception instance
This modifies the original instance and returns it, it does not clone
t
- the Throwable whose stack trace we want to sanitize
public static void printSanitizedStackTrace(java.lang.Throwable t, java.io.PrintWriter p)
public static void printSanitizedStackTrace(java.lang.Throwable t)
public static boolean isApplicationClass(java.lang.String className)
public static java.lang.Throwable extractRootCause(java.lang.Throwable t)
Extracts the root cause of the exception, no matter how nested it is
t
- a Throwable
public static java.lang.Throwable sanitizeRootCause(java.lang.Throwable t)
Get the root cause of an exception and sanitize it for display to the user
This will MODIFY the stacktrace of the root cause exception object and return it
t
- a throwable
public static java.lang.Throwable deepSanitize(java.lang.Throwable t)
Sanitize the exception and ALL nested causes
This will MODIFY the stacktrace of the exception instance and all its causes irreversibly
t
- a throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |