From 04ff8d8d40741a7b3322dbde329e82be8081c866 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Mon, 2 Jan 2023 11:20:34 +0000 Subject: [PATCH] cdp: return protocol errors --- src/lib/cdp.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/cdp.js b/src/lib/cdp.js index a4975fc..358b92b 100644 --- a/src/lib/cdp.js +++ b/src/lib/cdp.js @@ -44,6 +44,8 @@ export default async ({ pipe: { pipeWrite, pipeRead } = {}, port }) => { onReply[id] = msg => res(msg); }); + if (reply.error) return new Error(reply.error.message); + return reply.result; };