node/test/fixtures/uncaught-exceptions/domain.js
Ruben Bridgewater 1450ea7bf6
test: improve logged errors
To indicate which lines are test lines and which from Node.js core,
it's good to rely on `util.inspect()` while inspecting errors.

The stack was accessed directly instead in multiple cases and logging
that does not provide as much information as using `util.inspect()`.

PR-URL: https://github.com/nodejs/node/pull/31425
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
2020-02-09 13:36:39 +01:00

12 lines
219 B
JavaScript

const domain = require('domain');
var d = domain.create();
d.on('error', function(err) {
console.log('[ignored]', err);
});
d.run(function() {
setImmediate(function() {
throw new Error('in domain');
});
});