mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: add retry for 403
This commit is contained in:
parent
1050bcc57c
commit
8ea7ab07ec
2 changed files with 3 additions and 0 deletions
|
|
@ -86,6 +86,9 @@ export class OfficialChatGPTClient {
|
|||
referrer: 'https://chat.openai.com/chat'
|
||||
}
|
||||
const res = await this._fetch(url, option)
|
||||
if (res.status === 403) {
|
||||
return await this.sendMessage(prompt, opts)
|
||||
}
|
||||
if (res.status !== 200) {
|
||||
let body = await res.json()
|
||||
throw new Error(JSON.stringify(body, null, 2))
|
||||
|
|
|
|||
0
utils/uploadRecords.js
Normal file
0
utils/uploadRecords.js
Normal file
Loading…
Add table
Add a link
Reference in a new issue