if ((re.getClass() == RuntimeException.class) && (re.getCause() != null)) {
// unwrap to the real exception
t = re.getCause();
}
StringWriter writer = new StringWriter();
new ErrorReporter(t, false).write(new PrintWriter(writer));
String message = writer.toString();
if (failOnError) {
log(message, Project.MSG_INFO);
throw new BuildException("Compilation Failed", t, getLocation());