kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: remove unnecessary console logging
Removes unnecessary console logging in `checkForChatGPTAtCapacity()` and puts the alert message into the error message.chatgpt-api-old-v3
rodzic
e2ef624e8e
commit
5a62c9f83f
|
@ -231,14 +231,12 @@ async function checkForChatGPTAtCapacity(page: Page) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
res = await page.$('[role="alert"]')
|
res = await page.$('[role="alert"]')
|
||||||
console.log('capacity text', res)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore errors likely due to navigation
|
// ignore errors likely due to navigation
|
||||||
console.warn(err.toString())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
const error = new types.ChatGPTError('ChatGPT is at capacity')
|
const error = new types.ChatGPTError(`ChatGPT is at capacity: ${res}`)
|
||||||
error.statusCode = 503
|
error.statusCode = 503
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue