puppeteer-extra icon indicating copy to clipboard operation
puppeteer-extra copied to clipboard

Ability to handle unhandled rejections in puppeteer-extra

Open cjroebuck opened this issue 4 years ago • 0 comments

The calls to e.g. page.evaluateOnNewDocument within the puppeteer-extra modules are not wrapped with a try/catch, so if a page gets redirected whilst processing, these calls end up throwing unhandled rejections with e.g. Target closed errors.

Is there a way you could wrap these calls and let us pass in an option specifying whether we want to throw or swallow these errors. At the moment I think the only way to handle these is to have a global unhandledRejection handler.

cjroebuck avatar Apr 29 '20 19:04 cjroebuck