var domain = require('domain').create();
domain.run(function() {
setTimeout(function() { throw Error('FAIL'); }, 1);
setTimeout(function() { console.log('timeout 1'); }, 1);
setTimeout(function() { console.log('timeout 2'); }, 2);
});
domain.once('error', function() {});
Expected output:
Actual output:
(EDIT: I forgot to mention that you may need to run the test a few times.)