mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 增加创建对话的错误提示
This commit is contained in:
parent
da04370ff5
commit
88a97b6c92
1 changed files with 7 additions and 1 deletions
|
|
@ -103,7 +103,13 @@ export default class SydneyAIClient {
|
|||
fetchOptions.agent = proxy(Config.proxy)
|
||||
}
|
||||
const response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions)
|
||||
return response.json()
|
||||
let text = await response.text()
|
||||
try {
|
||||
return JSON.parse(text)
|
||||
} catch (err) {
|
||||
logger.error('创建sydney对话失败', text)
|
||||
throw new Error(text)
|
||||
}
|
||||
}
|
||||
|
||||
async createWebSocketConnection () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue