mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Add error messaging for 429 errors (#1316)
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user