From dc76bcc433d58d879f8850ac777d2cd239dad611 Mon Sep 17 00:00:00 2001 From: Abhi <43648792+abhipatel12@users.noreply.github.com> Date: Mon, 23 Jun 2025 17:30:13 -0400 Subject: Add error messaging for 429 errors (#1316) --- packages/cli/src/ui/hooks/useGeminiStream.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/cli/src/ui/hooks') 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') { -- cgit v1.2.3