ドメインが以下のエラーを処理しないのはなぜですか?
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);
});