mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Add error messaging for 429 errors (#1316)
This commit is contained in:
parent
21e6a36cf1
commit
dc76bcc433
7 changed files with 139 additions and 45 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue