presto-main/src/main/java/io/prestosql/dispatcher/FailedDispatchQuery.java/FailedDispatchQuery/immediateFailureQueryInfo
class FailedDispatchQuery:    private static QueryInfo immediateFailureQueryInfo(
            Session session,
            String query,
            Optional<String> preparedQuery,
            URI self,
            Optional<ResourceGroupId> resourceGroupId,
            Throwable throwable)
    {
        ExecutionFailureInfo failureCause = toFailure(throwable);
        QueryInfo queryInfo = new QueryInfo(
                session.getQueryId(),
                session.toSessionRepresentation(),
                FAILED,
                GENERAL_POOL,
                false,
                self,
                ImmutableList.of(),
                query,
                preparedQuery,
                immediateFailureQueryStats(),
                Optional.empty(),
                Optional.empty(),
                Optional.empty(),
                ImmutableMap.of(),
                ImmutableSet.of(),
                ImmutableMap.of(),
                ImmutableMap.of(),
                ImmutableSet.of(),
                Optional.empty(),
                false,
                null,
                Optional.empty(),
                failureCause,
                failureCause.getErrorCode(),
                ImmutableList.of(),
                ImmutableSet.of(),
                Optional.empty(),
                true,
                resourceGroupId);

        return queryInfo;
    }