presto-main/src/main/java/io/prestosql/execution/QueryStateMachine.java/QueryStateMachine/getFailureInfo
class QueryStateMachine:    public Optional<ExecutionFailureInfo> getFailureInfo()
    {
        if (queryState.get() != FAILED) {
            return Optional.empty();
        }
        return Optional.ofNullable(this.failureCause.get());
    }