Add error messaging for 429 errors (#1316)

This commit is contained in:
Abhi
2025-06-23 17:30:13 -04:00
committed by GitHub
parent 21e6a36cf1
commit dc76bcc433
7 changed files with 139 additions and 45 deletions

View File

@@ -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') {