fix: remove unnecessary console logging

Removes unnecessary console logging in `checkForChatGPTAtCapacity()` and puts the alert message into the error message.
chatgpt-api-old-v3
Joel 2022-12-14 13:17:21 -08:00 zatwierdzone przez GitHub
rodzic e2ef624e8e
commit 5a62c9f83f
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -231,14 +231,12 @@ async function checkForChatGPTAtCapacity(page: Page) {
try {
res = await page.$('[role="alert"]')
console.log('capacity text', res)
} catch (err) {
// ignore errors likely due to navigation
console.warn(err.toString())
}
if (res) {
const error = new types.ChatGPTError('ChatGPT is at capacity')
const error = new types.ChatGPTError(`ChatGPT is at capacity: ${res}`)
error.statusCode = 503
throw error
}