feat: 增加 zAI 的错误捕获

This commit is contained in:
foxhui
2026-01-02 03:18:42 +08:00
Unverified
parent aa422f0261
commit 8c80fa5e7a
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -277,7 +277,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completions',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request'],
errorText: ['Model is unable to process your request', 'Rate limit reached'],
meta
});
} catch (e) {
@@ -313,7 +313,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completed',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request'],
errorText: ['Model is unable to process your request', 'Rate limit reached'],
meta
});
} catch (e) {
+2
View File
@@ -257,6 +257,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completions',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request', 'Rate limit reached'],
meta
});
} catch (e) {
@@ -292,6 +293,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
urlMatch: 'chat/completed',
method: 'POST',
timeout: 120000,
errorText: ['Model is unable to process your request', 'Rate limit reached'],
meta
});
} catch (e) {