diegosouzapw/OmniRoute · error · Error

GraphQL HTTP ${res.status}: ${text.slice(0, 400)}

Error message

GraphQL HTTP ${res.status}: ${text.slice(0, 400)}

What it means

Error "GraphQL HTTP ${res.status}: ${text.slice(0, 400)}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at open-sse/executors/promptql.ts:255

      accept: "application/json",
      "content-type": "application/json",
      authorization: `Bearer ${token}`,
      origin: "https://prompt.ql.app",
      referer: "https://prompt.ql.app/",
      "user-agent": USER_AGENT,
    },
    body: JSON.stringify({ query, variables, operationName }),
    signal: signal ?? undefined,
  });
  const text = await res.text();
  let json: { data?: T; errors?: Array<{ message?: string }> };
  try {
    json = JSON.parse(text) as typeof json;
  } catch {
    throw new Error(`Non-JSON GraphQL HTTP ${res.status}: ${text.slice(0, 300)}`);
  }
  if (!res.ok) {
    throw new Error(`GraphQL HTTP ${res.status}: ${text.slice(0, 400)}`);
  }
  if (json.errors?.length) {
    throw new Error(json.errors.map((e) => e.message || "error").join("; "));
  }
  return json.data as T;
}

/**
 * Best-effort JWT refresh. Requires browser session cookies (credentials: include
 * in the SPA). Headless callers must store those cookies in providerSpecificData.cookie.
 * **Not fully verified in production** — see PR notes.
 */
export async function tryRefreshPromptQlToken(opts: {
  projectId: string;
  cookie?: string;
  signal?: AbortSignal | null;
}): Promise<string | null> {
  if (!opts.cookie || !opts.projectId) return null;

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at open-sse/executors/promptql.ts:255 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/4a39ce415fbdfb32. Report an issue: GitHub.