Skip to content

Commit 4a1cb3d

Browse files
BridgeARtargos
authored andcommitted
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 <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 625ed70 commit 4a1cb3d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/internal/util/inspector.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ function sendInspectorCommand(cb, onError) {
1010
if (!hasInspector) return onError();
1111
const inspector = require('inspector');
1212
if (session === undefined) session = new inspector.Session();
13+
session.connect();
1314
try {
14-
session.connect();
15-
try {
16-
return cb(session);
17-
} finally {
18-
session.disconnect();
19-
}
20-
} catch {
21-
return onError();
15+
return cb(session);
16+
} finally {
17+
session.disconnect();
2218
}
2319
}
2420

0 commit comments

Comments
 (0)