/*
  * Update the task with necessary information when the task is wrong.
  */
 private void updateErrorTask(Task task, String message, Throwable t) {
   TaskError error = new TaskError(message);
   error.setMajorErrorCode(t.getMessage());
   error.setMinorErrorCode(t.getClass().getSimpleName());
   task.setEndTime(new Date());
   task.setStatus(TaskStates.ERROR);
   task.setError(error);
   taskManager.updateTask(task);
   LOGGER.info(
       "An error occurs while deleting a node fromChef Server. See task "
           + task.getHref()
           + "for more information");
 }