mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +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': '',
|
'2captchaToken': '',
|
||||||
// http或socks5代理
|
// http或socks5代理
|
||||||
proxy: PROXY,
|
proxy: PROXY,
|
||||||
debug: false
|
debug: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,9 @@ export class OfficialChatGPTClient {
|
||||||
logger.mark(fullResponse)
|
logger.mark(fullResponse)
|
||||||
}
|
}
|
||||||
fullResponse = JSON.parse(fullResponse)
|
fullResponse = JSON.parse(fullResponse)
|
||||||
if (!fullResponse.message) {
|
if (!fullResponse?.message) {
|
||||||
throw new Error(fullResponse.detail || 'unkown error')
|
let detail = JSON.parse(bodyText)
|
||||||
|
throw new Error(detail.detail || 'unkown error')
|
||||||
}
|
}
|
||||||
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