Throwable exception = failure.getException();
if (exception == null) {
console.error(failure.getMessage());
}
else {
StackTraceFilterer filterer = new DefaultStackTraceFilterer();
filterer.setCutOffPackage("org.junit");
filterer.filter(exception, true);
StringWriter sw = new StringWriter();
PrintWriter ps = new PrintWriter(sw);
exception.printStackTrace(ps);