From 224c3d8809b92b7118e538ecf9f87b7488ae05b0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 19 Jul 2021 15:59:06 +0200 Subject: [PATCH] fixup! debugger: use ERR_DEBUGGER_ERROR in debugger client --- lib/internal/inspector/inspect_client.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/internal/inspector/inspect_client.js b/lib/internal/inspector/inspect_client.js index cd277a4cf5a946..8fc9011ca888ed 100644 --- a/lib/internal/inspector/inspect_client.js +++ b/lib/internal/inspector/inspect_client.js @@ -180,7 +180,9 @@ class Client extends EventEmitter { debuglog('< %s', payloadStr); const lastChar = payloadStr[payloadStr.length - 1]; if (payloadStr[0] !== '{' || lastChar !== '}') { - throw new ERR_DEBUGGER_ERROR(`Payload does not look like JSON: ${payloadStr}`); + throw new ERR_DEBUGGER_ERROR( + `Payload does not look like JSON: ${payloadStr}` + ); } let payload; try { @@ -251,14 +253,17 @@ class Client extends EventEmitter { function parseChunks() { const resBody = Buffer.concat(chunks).toString(); if (httpRes.statusCode !== 200) { - reject(new ERR_DEBUGGER_ERROR(`Unexpected ${httpRes.statusCode}: ${resBody}`)); + reject(new ERR_DEBUGGER_ERROR( + `Unexpected ${httpRes.statusCode}: ${resBody}` + )); return; } try { resolve(JSONParse(resBody)); } catch { - reject(new ERR_DEBUGGER_ERROR(`Response didn't contain JSON: ${resBody}`)); - + reject(new ERR_DEBUGGER_ERROR( + `Response didn't contain JSON: ${resBody}` + )); } }