public class TestStacktraceSanitizer {
private static final String TEST_RUNNING_CLASS = "_GrailsTest";
public static Throwable sanitize(Throwable t) {
new DefaultStackTraceFilterer().filter(t, true);
StackTraceElement[] trace = t.getStackTrace();
List<StackTraceElement> newTrace = new ArrayList<StackTraceElement>();
for (StackTraceElement stackTraceElement : trace) {
if (stackTraceElement.getClassName().startsWith(TEST_RUNNING_CLASS)) {
break;