Commit dd872320 authored by Travis Fischer's avatar Travis Fischer

feat: trying to fix capacity testing

parent ae9eedc1
......@@ -229,13 +229,14 @@ async function checkForChatGPTAtCapacity(page: Page) {
let res: ElementHandle<Node>[]
try {
// res = await page.$('[role="alert"]')
res = await page.$x("//div[contains(., 'ChatGPT is at capacity')]")
} catch (err) {
// ignore errors likely due to navigation
}
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
throw error
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment