{"record":{"id":"b8398db2f04fbea7","repo":"heygen-com/hyperframes","slug":"aborted","errorCode":null,"errorMessage":"Aborted.","messagePattern":"Aborted\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/auth/login.ts","lineNumber":491,"sourceCode":"      reject(err);\n    });\n  });\n}\n\nasync function promptForKey(): Promise<string> {\n  const clack = await import(\"@clack/prompts\");\n  const value = await clack.password({\n    message: \"Enter HeyGen API key\",\n    validate: (v) => {\n      if (!v || v.length < MIN_KEY_LENGTH) return \"API key looks too short\";\n      if (!isHeaderSafe(v)) return \"API key must not contain newline or control characters\";\n      return undefined;\n    },\n  });\n  if (clack.isCancel(value)) {\n    // Throw rather than exit here so the single catch in runApiKeyLogin records\n    // the abandonment (auth_login_failed: aborted) and then exits.\n    throw new Error(\"Aborted.\");\n  }\n  return value.trim();\n}\n","sourceCodeStart":473,"sourceCodeEnd":495,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/commands/auth/login.ts#L473-L495","documentation":"Generic Error 'Aborted.' thrown by the HeyGen API-key login flow when the user cancels the @clack/prompts password prompt (Esc, Ctrl+C, or the cancel button). It is intentionally thrown rather than process.exit'd so the single catch in runApiKeyLogin can record the abandonment (auth_login_failed: aborted) and exit cleanly. It is not a credentials failure.","triggerScenarios":"The user hits Esc/Ctrl+C at the 'Enter HeyGen API key' password prompt; the TTY is closed mid-input; a non-interactive context where clack resolves to a cancel symbol.","commonSituations":"Running `hyperframes auth login` by mistake and bailing out; a wrapper script that cannot supply a TTY; the user decides to paste the key via env var instead.","solutions":["If the cancellation was unintended, re-run `hyperframes auth login`.","To skip the prompt entirely, set the API key via the documented env var (e.g. HEYGEN_API_KEY) instead of the interactive flow.","Ensure a real TTY is attached when scripting login, or pre-seed the key non-interactively."],"exampleFix":"# before: interactive prompt you can't answer in CI\n$ hyperframes auth login   # Aborted.\n\n# after: non-interactive env var\n$ HEYGEN_API_KEY=... hyperframes <command>","handlingStrategy":"try-catch","validationCode":"// Pre-check: skip the prompt entirely if a key is already available\nif (!process.env.HEYGEN_API_KEY && !process.stdout.isTTY) {\n  throw new Error('No API key and no TTY — set HEYGEN_API_KEY before running.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runApiKeyLogin();\n} catch (err) {\n  if (err instanceof Error && err.message === 'Aborted.') {\n    // user cancelled — exit cleanly, not a failure\n  }\n}","preventionTips":["Prefer setting HEYGEN_API_KEY (env) for non-interactive / CI runs.","Ensure a real TTY when invoking the interactive login flow.","Treat 'Aborted.' as user cancel, not an auth failure."],"tags":["cli","auth","interactive","user-cancel"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}