private CommandReport createErrorReport(String message) {
    CommandReport commandReport = new CommandReport();
    commandReport.setStatus(HostRoleStatus.FAILED.toString());
    commandReport.setExitCode(1);
    commandReport.setStdOut("Server action failed");
    commandReport.setStdErr((message == null) ? "Server action failed" : message);
    return commandReport;
  }
A helper method to create CommandReports indicating the action/task has had an error

@param message a String containing the error message to report
@return a new CommandReport
ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java