kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: trying to fix capacity testing
rodzic
ae9eedc138
commit
dd872320ae
|
@ -229,13 +229,14 @@ async function checkForChatGPTAtCapacity(page: Page) {
|
||||||
let res: ElementHandle<Node>[]
|
let res: ElementHandle<Node>[]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// res = await page.$('[role="alert"]')
|
||||||
res = await page.$x("//div[contains(., 'ChatGPT is at capacity')]")
|
res = await page.$x("//div[contains(., 'ChatGPT is at capacity')]")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore errors likely due to navigation
|
// ignore errors likely due to navigation
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res?.length) {
|
if (res?.length) {
|
||||||
const error = new types.ChatGPTError(`ChatGPT is at capacity: ${res}`)
|
const error = new types.ChatGPTError('ChatGPT is at capacity')
|
||||||
error.statusCode = 503
|
error.statusCode = 503
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue