Skip to content
Permalink
Browse files

lib: do not catch user errors

The API caught errors from inside of the users passed through callback.
This never caused any issues, since this API is only used internally.
Otherwise it would have potentially hidden bugs in user code.

Refs: #31133

PR-URL: #31159
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
BridgeAR authored and targos committed Jan 1, 2020
1 parent 7b696fe commit 4b2d8df5b501115ef401b0284bb8e970a70d9bce
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/internal/util/inspector.js
@@ -10,15 +10,11 @@ function sendInspectorCommand(cb, onError) {
if (!hasInspector) return onError();
const inspector = require('inspector');
if (session === undefined) session = new inspector.Session();
session.connect();
try {
session.connect();
try {
return cb(session);
} finally {
session.disconnect();
}
} catch {
return onError();
return cb(session);
} finally {
session.disconnect();
}
}

0 comments on commit 4b2d8df

Please sign in to comment.
You can’t perform that action at this time.