Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -124,7 +124,7 @@ class Utils {
|
|
| 124 |
message: `${retryError.message}已重新刷新认证信息,请重新对话`,
|
| 125 |
type: 'server_error',
|
| 126 |
param: null,
|
| 127 |
-
code:
|
| 128 |
}
|
| 129 |
});
|
| 130 |
} else {
|
|
@@ -518,7 +518,6 @@ async function handleStreamResponse(response, model, res) {
|
|
| 518 |
const linejosn = JSON.parse(data);
|
| 519 |
if (linejosn?.error?.name === "RateLimitError") {
|
| 520 |
var responseData = MessageProcessor.createChatResponse(`${linejosn.error.name},请重新对话`, model, true);
|
| 521 |
-
fs.unlinkSync(path.resolve(process.cwd(), 'signature.json'));
|
| 522 |
CONFIG.API.SIGNATURE_COOKIE = null;
|
| 523 |
console.log("认证信息已删除");
|
| 524 |
res.write(`data: ${JSON.stringify(responseData)}\n\n`);
|
|
|
|
| 124 |
message: `${retryError.message}已重新刷新认证信息,请重新对话`,
|
| 125 |
type: 'server_error',
|
| 126 |
param: null,
|
| 127 |
+
code: error.code || null
|
| 128 |
}
|
| 129 |
});
|
| 130 |
} else {
|
|
|
|
| 518 |
const linejosn = JSON.parse(data);
|
| 519 |
if (linejosn?.error?.name === "RateLimitError") {
|
| 520 |
var responseData = MessageProcessor.createChatResponse(`${linejosn.error.name},请重新对话`, model, true);
|
|
|
|
| 521 |
CONFIG.API.SIGNATURE_COOKIE = null;
|
| 522 |
console.log("认证信息已删除");
|
| 523 |
res.write(`data: ${JSON.stringify(responseData)}\n\n`);
|