Closed
Description
- Version: master
- Platform: Linux blocky 4.13.0-38-generic The binary and long term compatibility with node #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
REPL commands
$ node
> process.on('uncaughtException', (err) => console.log('caught' + err));
> throw 'hi';
OUTPUT :
Thrown: hi
Running process.hasUncaughtExceptionCaptureCallback()
in the REPL console outputs true
, so it is understandable why the listener isn't called.
However
> process.setUncaughtExceptionCaptureCallback(null);
throws the Error:
Error [ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE]: The `domain` module is in use, which is mutually exclusive with calling process.setUncaughtExceptionCaptureCallback()
at process.setUncaughtExceptionCaptureCallback (domain.js:97:15)
at repl:1:9
at Script.runInThisContext (vm.js:91:20)
at REPLServer.defaultEval (repl.js:311:29)
at bound (domain.js:396:14)
at REPLServer.runBound [as eval] (domain.js:409:12)
at REPLServer.onLine (repl.js:609:10)
at REPLServer.emit (events.js:187:15)
at REPLServer.emit (domain.js:442:20)
at REPLServer.Interface._onLine (readline.js:285:10)
----------------------------------------
Error: require(`domain`) at this point
at domain.js:93:28
at NativeModule.compile (internal/bootstrap/loaders.js:209:7)
at NativeModule.require (internal/bootstrap/loaders.js:137:18)
at repl.js:63:16
at NativeModule.compile (internal/bootstrap/loaders.js:209:7)
at NativeModule.require (internal/bootstrap/loaders.js:137:18)
at internal/repl.js:4:14
at NativeModule.compile (internal/bootstrap/loaders.js:209:7)
at Function.NativeModule.require (internal/bootstrap/loaders.js:137:18)
at startup (internal/bootstrap/node.js:240:40)
I could not find any documentation of this behaviour for the Node REPL.
Is this a bug, or is this a desired behaviour which has to be documented?