Closed
Description
Using this code:
const Domain = require('domain');
const d = Domain.create();
process.once('unhandledRejection', function(r, p){
console.log('unhandledRejection', r, p);
});
d.once('error', function(){
console.log('domain caught');
});
d.run(function(){
Promise.resolve(null).then(function(){
throw 'foo';
});
});
the domain error event handler won't be touched -> the exception will be sent to the unhandledRejection handler, but the promise will have the domain instance pinned to it. I assume this is expected behavior, but since we have the domain, why not fire it's error event instead of firing unhandledRejection?
Metadata
Metadata
Assignees
Labels
No labels