From 36fa1ba655f1cc76fe7340eaf7a9e4bd6555e9ee Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Tue, 10 Dec 2013 14:29:46 +0400 Subject: [PATCH] log fatal errors --- lib/cli.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cli.js b/lib/cli.js index a26a57bfa..d7de71135 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -119,3 +119,8 @@ function write_config_banner(def, config) { console.log('===========================================================') } +process.on('uncaughtException', function(err) { + logger.logger.fatal({err: err}, 'uncaught exception, please report this\n@{err.stack}') + process.exit(255) +}) +