presto-main/src/main/java/io/prestosql/server/BasicQueryInfo.java/BasicQueryInfo/immediateFailureQueryInfo
class BasicQueryInfo:    public static BasicQueryInfo immediateFailureQueryInfo(Session session, String query, URI self, Optional<ResourceGroupId> resourceGroupId, ErrorCode errorCode)
    {
        return new BasicQueryInfo(
                session.getQueryId(),
                session.toSessionRepresentation(),
                resourceGroupId,
                FAILED,
                GENERAL_POOL,
                false,
                self,
                query,
                Optional.empty(),
                immediateFailureQueryStats(),
                errorCode == null ? null : errorCode.getType(),
                errorCode);
    }