diff options
| author | Abhi <[email protected]> | 2025-06-23 23:43:00 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-24 03:43:00 +0000 |
| commit | d3f13c71ae78494b69c36a6d62dd9b3852bdfec2 (patch) | |
| tree | e82a7dc5d35caa1c49360ce03c9a7cef40862de5 /packages/cli/src/ui/hooks/useGeminiStream.ts | |
| parent | f7caca5f941c7ab1f4c25f2d117b2217703e7d79 (diff) | |
feat: add custom message for 429 errors (#1366)
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index 86540b68..a8816f98 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -398,12 +398,15 @@ export const useGeminiStream = ( addItem( { type: MessageType.ERROR, - text: parseAndFormatApiError(eventValue.error), + text: parseAndFormatApiError( + eventValue.error, + config.getContentGeneratorConfig().authType, + ), }, userMessageTimestamp, ); }, - [addItem, pendingHistoryItemRef, setPendingHistoryItem], + [addItem, pendingHistoryItemRef, setPendingHistoryItem, config], ); const handleChatCompressionEvent = useCallback( @@ -533,10 +536,6 @@ export const useGeminiStream = ( setPendingHistoryItem(null); } } catch (error: unknown) { - console.log( - 'GEMINI_DEBUG: Caught error in useGeminiStream.ts:', - JSON.stringify(error), - ); if (error instanceof UnauthorizedError) { onAuthError(); } else if (!isNodeError(error) || error.name !== 'AbortError') { @@ -545,6 +544,7 @@ export const useGeminiStream = ( type: MessageType.ERROR, text: parseAndFormatApiError( getErrorMessage(error) || 'Unknown error', + config.getContentGeneratorConfig().authType, ), }, userMessageTimestamp, @@ -566,6 +566,7 @@ export const useGeminiStream = ( geminiClient, startNewTurn, onAuthError, + config, ], ); |
