Improve "Execution context was destroyed" error handling

This commit is contained in:
ngosang 2021-08-01 22:10:53 +02:00
parent 9dae74bc28
commit 447c8f67a1

View File

@ -73,8 +73,10 @@ export default async function resolveChallenge(url: string, page: Page, response
} catch (error) } catch (error)
{ {
log.debug("Unexpected error: " + error); log.debug("Unexpected error: " + error);
if (!error.toString().includes("Execution context was destroyed")) {
break break
} }
}
log.debug('Waiting for Cloudflare challenge...') log.debug('Waiting for Cloudflare challenge...')
await page.waitFor(1000) await page.waitFor(1000)