|
Groovy 1.8.4 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.StackTraceUtils
public class StackTraceUtils extends Object
Originally was grails.utils.GrailsUtils, removed some grails specific stuff. Utility methods removing internal lines from stack traces
Field Summary | |
---|---|
static String |
STACK_LOG_NAME
|
Method Summary | |
---|---|
static void
|
addClassTest(Closure test)
|
static Throwable
|
deepSanitize(Throwable t)
|
static Throwable
|
extractRootCause(Throwable t)
|
static boolean
|
isApplicationClass(String className)
|
static void
|
printSanitizedStackTrace(Throwable t, PrintWriter p)
|
static void
|
printSanitizedStackTrace(Throwable t)
|
static Throwable
|
sanitize(Throwable t)
|
static Throwable
|
sanitizeRootCause(Throwable t)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final String STACK_LOG_NAME
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.Closure
public static Throwable deepSanitize(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
public static Throwable extractRootCause(Throwable t)
Extracts the root cause of the exception, no matter how nested it is
t
- a Throwable
public static boolean isApplicationClass(String className)
public static void printSanitizedStackTrace(Throwable t, PrintWriter p)
public static void printSanitizedStackTrace(Throwable t)
public static Throwable sanitize(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 Throwable sanitizeRootCause(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
Copyright © 2003-2011 The Codehaus. All rights reserved.