mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
restore uncaughrexception logic
This commit is contained in:
parent
7f3c2d393c
commit
641f4e79d9
5
examples/killslow.js
Normal file
5
examples/killslow.js
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
throw new Error('ok');
|
||||
}, 1100);
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user