1
Pourquoi le domaine ne gère pas l'erreur ci-dessous?Pourquoi les domaines ne sont pas interceptés en dessous de l'exception?
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);
});
Encore une fois, il fonctionne parfaitement avec le code ci-dessous,
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);
});