From cce174bee8512604ef5703ee5e636552ae2ac097 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Wed, 15 Nov 2023 02:32:58 +0300 Subject: [PATCH] fix: ignore puppeteer ProtocolError in workers --- src/utils/processor.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/processor.js b/src/utils/processor.js index 4250a8388..3594eb00b 100644 --- a/src/utils/processor.js +++ b/src/utils/processor.js @@ -2,9 +2,15 @@ const _ = require("lodash"); const { WORKER_UNHANDLED_REJECTION } = require("../constants/process-messages"); +const logger = require("./logger"); const ipc = require("./ipc"); process.on("unhandledRejection", (reason, p) => { + if (reason && reason.name === "ProtocolError") { + logger.warn(`Unhandled Rejection "${reason}" in hermione:worker:${process.pid} was ignored`); + return; + } + const error = `Unhandled Rejection in hermione:worker:${process.pid}:\nPromise: ${JSON.stringify( p, )}\nReason: ${reason}`;