summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-06-23 17:30:13 -0400
committerGitHub <[email protected]>2025-06-23 21:30:13 +0000
commitdc76bcc433d58d879f8850ac777d2cd239dad611 (patch)
tree89458926149f83721f00f09a5b5b3130d571bda5 /packages/cli/src/ui/hooks/useGeminiStream.ts
parent21e6a36cf1b17ff126b3d0253e68a6f3ebfc7c36 (diff)
Add error messaging for 429 errors (#1316)
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 921fbdb1..e045fdeb 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -396,7 +396,10 @@ export const useGeminiStream = (
setPendingHistoryItem(null);
}
addItem(
- { type: MessageType.ERROR, text: `[API Error: ${eventValue.message}]` },
+ {
+ type: MessageType.ERROR,
+ text: parseAndFormatApiError(eventValue.error),
+ },
userMessageTimestamp,
);
},
@@ -530,6 +533,10 @@ export const useGeminiStream = (
setPendingHistoryItem(null);
}
} catch (error: unknown) {
+ console.log(
+ 'GEMINI_DEBUG: Caught error in useGeminiStream.ts:',
+ JSON.stringify(error),
+ );
if (isAuthError(error)) {
onAuthError();
} else if (!isNodeError(error) || error.name !== 'AbortError') {