为什么域不处理以下错误?
var globalDomain = domain.createDomain();
globalDomain.run( function() {
// Why below exception does not get handled by globalDomain?
throw "some error";
});
globalDomain.on('error', function(msg) {
console.log("In global error event:" + msg);
});
同样,它与以下代码完美配合,
var globalDomain = domain.createDomain();
globalDomain.run( function() {
setTimeout(function(){
throw "some error from timeout";
},0);
});
globalDomain.on('error', function(msg) {
console.log("In global error event:" + msg);
});