fix: 修改api3出错的信息显示形式

This commit is contained in:
ikechan8370 2023-03-23 20:32:12 +08:00
parent 117293cc18
commit 3c5604b2fb

View file

@ -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')