Skip to content

Commit

Permalink
fix: ignore puppeteer ProtocolError in workers
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovRoman committed Nov 14, 2023
1 parent 21666a8 commit cce174b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit cce174b

Please sign in to comment.