From e371a85b24d1dcb1c278c49c6e2ed64d598de5cf Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 20 Jul 2022 14:27:41 -0400 Subject: [PATCH] *Handle ProtocolError errors --- src/sandbox.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sandbox.ts b/src/sandbox.ts index ba57043..e2517d8 100644 --- a/src/sandbox.ts +++ b/src/sandbox.ts @@ -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; + } +});