diff --git a/lib/track.js b/lib/track.js index 5af98adfd..19e3618d0 100644 --- a/lib/track.js +++ b/lib/track.js @@ -27,6 +27,11 @@ exports.createTracker = function (on_exit) { } }; + process.on('uncaughtException', function (err) { + console.error(err.stack); + process.exit(1); + }); + process.on('exit', function() { on_exit = on_exit || exports.default_on_exit; on_exit(tracker);