mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: change error msg
This commit is contained in:
parent
133eb0e87d
commit
b5e8ad1034
1 changed files with 2 additions and 4 deletions
|
|
@ -73,12 +73,10 @@ export class OfficialChatGPTClient {
|
||||||
try {
|
try {
|
||||||
fullResponse = JSON.parse(fullResponse)
|
fullResponse = JSON.parse(fullResponse)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
let detail = JSON.parse(bodyText)
|
throw new Error(bodyText || 'unkown error, please check log')
|
||||||
throw new Error(detail.detail || 'unkown error, please check log')
|
|
||||||
}
|
}
|
||||||
if (!fullResponse?.message) {
|
if (!fullResponse?.message) {
|
||||||
let detail = JSON.parse(bodyText)
|
throw new Error(bodyText || 'unkown error, please check log')
|
||||||
throw new Error(detail.detail || 'unkown error, please check log')
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
text: fullResponse.message.content.parts[0],
|
text: fullResponse.message.content.parts[0],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue