diff --git a/utils/config.js b/utils/config.js index 80c549a..1c682eb 100644 --- a/utils/config.js +++ b/utils/config.js @@ -55,7 +55,7 @@ const defaultConfig = { noiseScaleW: 0.668, lengthScale: 1.2, initiativeChatGroups: [], - version: 'v2.1.3' + version: 'v2.1.4' } const _path = process.cwd() let config = {} diff --git a/utils/message.js b/utils/message.js index 585df0f..98962ac 100644 --- a/utils/message.js +++ b/utils/message.js @@ -86,6 +86,10 @@ export class OfficialChatGPTClient { referrer: 'https://chat.openai.com/chat' } const res = await this._fetch(url, option) + if (res.status !== 200) { + let body = await res.json() + throw new Error(JSON.stringify(body, null, 2)) + } const decoder = new TextDecoder('utf-8') const bodyBytes = await res.arrayBuffer() const bodyText = decoder.decode(bodyBytes)