presto-main/src/main/java/io/prestosql/execution/TaskStateMachine.java/TaskStateMachine/failed
class TaskStateMachine:    public void failed(Throwable cause)
    {
        failureCauses.add(cause);
        transitionToDoneState(TaskState.FAILED);
    }