From 3c5604b2fb73293c6162e241e61e95f17807bf53 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 23 Mar 2023 20:32:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9api3=E5=87=BA=E9=94=99?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/message.js b/utils/message.js index 923c87d..412826f 100644 --- a/utils/message.js +++ b/utils/message.js @@ -90,8 +90,8 @@ export class OfficialChatGPTClient { return await this.sendMessage(prompt, opts) } if (res.status !== 200) { - let body = await res.json() - throw new Error(JSON.stringify(body, null, 2)) + let body = await res.text() + throw new Error(body) } // todo accept as stream const decoder = new TextDecoder('utf-8')