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>
12 lines
219 B
JavaScript
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');
|
|
});
|
|
});
|