{"record":{"id":"78f886c569f1c040","repo":"diegosouzapw/OmniRoute","slug":"data-error-failed-to-select-identity","errorCode":null,"errorMessage":"data?.error || \"Failed to select identity\"","messagePattern":"data\\?\\.error \\|\\| \"Failed to select identity\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/providers/[id]/components/VolcengineConnectModal.tsx","lineNumber":279,"sourceCode":"            method: \"POST\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify({ index }),\n          }\n        );\n        const data = await response.json().catch(() => ({}));\n        if (data?.session) {\n          setSession((prev) => (prev ? { ...prev, ...data.session } : data.session));\n          if (\n            data.session.phase === \"starting\" ||\n            data.session.phase === \"sending_code\" ||\n            data.session.phase === \"submitting\"\n          ) {\n            startPolling(data.session.sessionId);\n          } else if (data.session.phase === \"success\") {\n            void onConnected();\n          }\n        } else {\n          throw new Error(data?.error || \"Failed to select identity\");\n        }\n      } catch (error) {\n        notify.error(error instanceof Error ? error.message : \"Failed to select identity\");\n      } finally {\n        setSelectingIdentity(false);\n      }\n    },\n    [session, notify, startPolling, onConnected]\n  );\n\n  const handleResend = useCallback(async () => {\n    if (!session || resendCountdown > 0) return;\n    setResending(true);\n    try {\n      const response = await fetch(\n        `/api/providers/volcengine-plan/connect/${session.sessionId}/resend`,\n        { method: \"POST\" }\n      );","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/providers/[id]/components/VolcengineConnectModal.tsx#L261-L297","documentation":"Thrown when selecting an identity (account chooser index) during Volcano connect fails — non-OK response or error field set. Indicates the session was invalid, the index was out of range, or the upstream rejected the identity choice.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/VolcengineConnectModal.tsx:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the identity selection","Restart the login flow if the session expired mid-choice","Verify the account actually has multiple identities server-side"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}