From f18ce47a3d33aa5355d0209882fcc94ad6a30803 Mon Sep 17 00:00:00 2001 From: "Cheng-Han, Wu" Date: Tue, 10 May 2016 09:37:41 +0800 Subject: [PATCH] Update to exit app when an uncaughtException occured. --- app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.js b/app.js index c3c824a..bfb9ac7 100644 --- a/app.js +++ b/app.js @@ -473,5 +473,8 @@ models.sequelize.sync().then(startListen); // log uncaught exception process.on('uncaughtException', function (err) { + logger.error('An uncaught exception has occured.'); logger.error(err); + logger.error('Process will exit now.'); + process.exit(1); }); \ No newline at end of file