{"record":{"id":"3cd7729f639ab673","repo":"diegosouzapw/OmniRoute","slug":"failed-to-import-credentials","errorCode":null,"errorMessage":"Failed to import credentials","messagePattern":"Failed to import credentials","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shared/components/oauthBlobSubmit.ts","lineNumber":38,"sourceCode":" * advances the modal to the success step and fires onSuccess; on failure it\n * THROWS so the caller's existing try/catch surfaces the error (keeps the modal\n * call site to two lines). Decoding + finalize + persist happen server-side.\n */\nexport async function submitCredentialBlob(\n  provider: string,\n  blob: string,\n  reauthConnection: { id?: string } | null | undefined,\n  setStep: (s: string) => void,\n  onSuccess?: () => void\n): Promise<void> {\n  const res = await fetch(`/api/oauth/${provider}/paste-credentials`, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ blob: blob.trim(), connectionId: reauthConnection?.id }),\n  });\n  const data = (await parseResponseBody(res)) as Record<string, unknown>;\n  if (!res.ok) {\n    throw new Error(getErrorMessage(data, res.status, \"Failed to import credentials\"));\n  }\n  setStep(\"success\");\n  onSuccess?.();\n}\n","sourceCodeStart":20,"sourceCodeEnd":43,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/components/oauthBlobSubmit.ts#L20-L43","documentation":"Error \"Failed to import credentials\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/components/oauthBlobSubmit.ts:38 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"}