mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
fix: 增加错误输出
This commit is contained in:
parent
c36a0f9c9c
commit
7c5e9ea434
1 changed files with 29 additions and 23 deletions
|
|
@ -156,6 +156,7 @@ export class ClaudeAIClient {
|
||||||
if (streamDataRes.status === 307) {
|
if (streamDataRes.status === 307) {
|
||||||
throw new Error('claude.ai目前不支持你所在的地区')
|
throw new Error('claude.ai目前不支持你所在的地区')
|
||||||
}
|
}
|
||||||
|
if (streamDataRes.status === 200) {
|
||||||
let streamData = streamDataRes.body
|
let streamData = streamDataRes.body
|
||||||
// console.log(streamData)
|
// console.log(streamData)
|
||||||
let responseText = ''
|
let responseText = ''
|
||||||
|
|
@ -182,6 +183,11 @@ export class ClaudeAIClient {
|
||||||
text: responseText.trim(),
|
text: responseText.trim(),
|
||||||
conversationId
|
conversationId
|
||||||
}
|
}
|
||||||
|
} else if (streamDataRes.status === 408) {
|
||||||
|
throw new Error('claude.ai响应超时,可能是回复文本太多,请调高超时时间重试')
|
||||||
|
} else {
|
||||||
|
throw new Error('unknown error')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue