{"record":{"id":"024e90cfa9b01990","repo":"diegosouzapw/OmniRoute","slug":"error","errorCode":null,"errorMessage":"error","messagePattern":"error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/promptql.ts","lineNumber":258,"sourceCode":"      origin: \"https://prompt.ql.app\",\n      referer: \"https://prompt.ql.app/\",\n      \"user-agent\": USER_AGENT,\n    },\n    body: JSON.stringify({ query, variables, operationName }),\n    signal: signal ?? undefined,\n  });\n  const text = await res.text();\n  let json: { data?: T; errors?: Array<{ message?: string }> };\n  try {\n    json = JSON.parse(text) as typeof json;\n  } catch {\n    throw new Error(`Non-JSON GraphQL HTTP ${res.status}: ${text.slice(0, 300)}`);\n  }\n  if (!res.ok) {\n    throw new Error(`GraphQL HTTP ${res.status}: ${text.slice(0, 400)}`);\n  }\n  if (json.errors?.length) {\n    throw new Error(json.errors.map((e) => e.message || \"error\").join(\"; \"));\n  }\n  return json.data as T;\n}\n\n/**\n * Best-effort JWT refresh. Requires browser session cookies (credentials: include\n * in the SPA). Headless callers must store those cookies in providerSpecificData.cookie.\n * **Not fully verified in production** — see PR notes.\n */\nexport async function tryRefreshPromptQlToken(opts: {\n  projectId: string;\n  cookie?: string;\n  signal?: AbortSignal | null;\n}): Promise<string | null> {\n  if (!opts.cookie || !opts.projectId) return null;\n  try {\n    const res = await fetch(TOKEN_REFRESH_URL, {\n      method: \"POST\",","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/promptql.ts#L240-L276","documentation":"Error \"error\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/executors/promptql.ts:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}