Skip to content

Commit 224c3d8

Browse files
committed
fixup! debugger: use ERR_DEBUGGER_ERROR in debugger client
1 parent dfdbda5 commit 224c3d8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/internal/inspector/inspect_client.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ class Client extends EventEmitter {
180180
debuglog('< %s', payloadStr);
181181
const lastChar = payloadStr[payloadStr.length - 1];
182182
if (payloadStr[0] !== '{' || lastChar !== '}') {
183-
throw new ERR_DEBUGGER_ERROR(`Payload does not look like JSON: ${payloadStr}`);
183+
throw new ERR_DEBUGGER_ERROR(
184+
`Payload does not look like JSON: ${payloadStr}`
185+
);
184186
}
185187
let payload;
186188
try {
@@ -251,14 +253,17 @@ class Client extends EventEmitter {
251253
function parseChunks() {
252254
const resBody = Buffer.concat(chunks).toString();
253255
if (httpRes.statusCode !== 200) {
254-
reject(new ERR_DEBUGGER_ERROR(`Unexpected ${httpRes.statusCode}: ${resBody}`));
256+
reject(new ERR_DEBUGGER_ERROR(
257+
`Unexpected ${httpRes.statusCode}: ${resBody}`
258+
));
255259
return;
256260
}
257261
try {
258262
resolve(JSONParse(resBody));
259263
} catch {
260-
reject(new ERR_DEBUGGER_ERROR(`Response didn't contain JSON: ${resBody}`));
261-
264+
reject(new ERR_DEBUGGER_ERROR(
265+
`Response didn't contain JSON: ${resBody}`
266+
));
262267
}
263268
}
264269

0 commit comments

Comments
 (0)