void handleExit(Task task, int sc, String message) { if (errorProperty != null) { task.getProject().setNewProperty(errorProperty, "true"); } if (failOnError) { throw new BuildException(message, task.getLocation()); } else { task.log(message, Project.MSG_ERR); } }