set_failed: Set task as failed
This is a method of the Task class in the task module.
def set_failed(&mut self, error: &str) -> ()