From dd872320ae524b6c15a0a44999e6c83b85391301 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 14 Dec 2022 16:14:35 -0600 Subject: [PATCH] feat: trying to fix capacity testing --- src/openai-auth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openai-auth.ts b/src/openai-auth.ts index e5d060c2..121fd424 100644 --- a/src/openai-auth.ts +++ b/src/openai-auth.ts @@ -229,13 +229,14 @@ async function checkForChatGPTAtCapacity(page: Page) { let res: ElementHandle[] 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 }