write(details);
}
protected void write(FailureDetails details) {
StyledTextOutput output = textOutputFactory.create(BuildExceptionReporter.class, LogLevel.ERROR);
output.println();
output.withStyle(Failure).text("FAILURE: ");
details.summary.replay(output.withStyle(Failure));
if (details.location.hasContent) {
output.println().println();
output.println("* Where:");
details.location.replay(output);
}
if (details.details.hasContent) {
output.println().println();
output.println("* What went wrong:");
details.details.replay(output);
}
if (details.resolution.hasContent) {
output.println().println();
output.println("* Try:");
details.resolution.replay(output);
}
Throwable exception = null;
switch (details.exception) {
case None:
break;
case Sanitized:
exception = StackTraceUtils.deepSanitize(details.failure);
break;
case Full:
exception = details.failure;
break;
}
if (exception != null) {
output.println().println();
output.println("* Exception is:");
output.exception(exception);
}
output.println();
}