restore uncaughrexception logic

This commit is contained in:
tknew2 2014-02-05 09:48:32 +01:00
parent 7f3c2d393c
commit 641f4e79d9
2 changed files with 11 additions and 10 deletions

5
examples/killslow.js Normal file
View File

@ -0,0 +1,5 @@
setTimeout(function() {
throw new Error('ok');
}, 1100);

View File

@ -104,16 +104,12 @@ function exec(script, outFile, errFile) {
}
});
process.exit(cst.CODE_UNCAUGHTEXCEPTION);
// if (!process.listeners('uncaughtException').filter(function (listener) {
// return listener !== uncaughtListener;
// }).length) {
// stderr.write(err.stack);
// process.exit(cst.CODE_UNCAUGHTEXCEPTION);
// }
if (!process.listeners('uncaughtException').filter(function (listener) {
return listener !== uncaughtListener;
}).length) {
stderr.write(err.stack);
process.exit(cst.CODE_UNCAUGHTEXCEPTION);
}
});