summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/Header.tsx
diff options
context:
space:
mode:
authorAllen Hutchison <[email protected]>2025-04-16 16:53:56 -0700
committerTaylor Mullen <[email protected]>2025-04-17 13:20:11 -0400
commitf10aaf7e7e063ffa29832223a241623a1c84333e (patch)
tree28500362129887afcbad4c60f572588680c48a95 /packages/cli/src/ui/components/Header.tsx
parent123c3050dc5e8a23a4ca05090286c5fc41a21d8f (diff)
fix: Suppress crash from unhandled 429 stream error via global handler
Introduces a process.on('unhandledRejection') handler in src/gemini.ts as a workaround for an issue where 429 ClientErrors originating from the @google/genai library's sendMessageStream during iteration can cause an unhandled rejection, even when caught within local try/catch blocks in the application code (e.g., in processGeminiStream). The handler specifically identifies this known 429 ClientError based on its type and message content. If matched, it logs a warning indicating the known issue is being suppressed and prevents process.exit(1). Any other genuinely unhandled promise rejections will still be logged as critical errors and will terminate the application, maintaining default behavior for unexpected issues. This workaround mitigates a suspected library-internal problem related to error propagation during asynchronous stream iteration.
Diffstat (limited to 'packages/cli/src/ui/components/Header.tsx')
0 files changed, 0 insertions, 0 deletions