cdp: don't throw error on closed send

This commit is contained in:
CanadaHonk 2023-01-28 12:10:36 +00:00
parent 5053e5335c
commit 1a74923cff

View File

@ -27,7 +27,7 @@ export default async ({ pipe: { pipeWrite, pipeRead } = {}, port }) => {
let msgId = 0;
const sendMessage = async (method, params = {}, sessionId = undefined) => {
if (closed) throw new Error('CDP connection closed');
if (closed) return new Error('CDP connection closed');
const id = msgId++;