From c1ca4f2f9bb10905347ff93c7021c970db4a674f Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 23 Mar 2023 21:03:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20api3=E5=AF=B9=E8=AF=9D=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=A2=9E=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/message.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/message.js b/utils/message.js index 412826f..911c0ca 100644 --- a/utils/message.js +++ b/utils/message.js @@ -91,7 +91,11 @@ export class OfficialChatGPTClient { } if (res.status !== 200) { let body = await res.text() - throw new Error(body) + if (body.indexOf('Conversation not found') > -1) { + throw new Error('对话不存在,请使用指令”#结束对话“结束当前对话后重新开始对话。') + } else { + throw new Error(body) + } } // todo accept as stream const decoder = new TextDecoder('utf-8')