mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: add 429 error
This commit is contained in:
parent
e5853fdb4b
commit
4330e61dc3
2 changed files with 4 additions and 3 deletions
|
|
@ -60,5 +60,5 @@ export const Config = {
|
|||
'2captchaToken': '',
|
||||
// http或socks5代理
|
||||
proxy: PROXY,
|
||||
debug: false
|
||||
debug: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,9 @@ export class OfficialChatGPTClient {
|
|||
logger.mark(fullResponse)
|
||||
}
|
||||
fullResponse = JSON.parse(fullResponse)
|
||||
if (!fullResponse.message) {
|
||||
throw new Error(fullResponse.detail || 'unkown error')
|
||||
if (!fullResponse?.message) {
|
||||
let detail = JSON.parse(bodyText)
|
||||
throw new Error(detail.detail || 'unkown error')
|
||||
}
|
||||
return {
|
||||
text: fullResponse.message.content.parts[0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue