mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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: https://github.com/nodejs/node/pull/31133 PR-URL: https://github.com/nodejs/node/pull/31159 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
36c212e25e
commit
904a81d235
1 file changed
+4
-8
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user