*Handle ProtocolError errors

This commit is contained in:
Derrick Hammer 2022-07-20 14:27:41 -04:00
parent 27fa4b977b
commit e371a85b24
1 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@
// @ts-ignore
import { loadTester, login } from "../dist/index.js";
import puppeteer, { Browser, Page } from "puppeteer";
import puppeteer, { Browser, Page, ProtocolError } from "puppeteer";
let browser: Browser;
@ -17,3 +17,8 @@ let browser: Browser;
process.on("SIGTERM", async () => {
await browser.close();
});
process.on("uncaughtException", (e) => {
if (!(e instanceof ProtocolError)) {
throw e;
}
});