From bb3b9004e0963d0c7a2b4c59275dde645d7d65c9 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 2 Sep 2015 23:03:47 -0700 Subject: [PATCH] database: exit if initial connection fails (#500) --- lib/database.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/database.js b/lib/database.js index f2b2e366..c8b84852 100644 --- a/lib/database.js +++ b/lib/database.js @@ -24,10 +24,9 @@ module.exports.init = function () { // Test the connection pool.getConnection(function (err, conn) { - if(err) { - Logger.errlog.log("! DB connection failed"); - Logger.errlog.log(err); - return; + if (err) { + Logger.errlog.log("Initial database connection failed: " + err.stack); + process.exit(1); } else { tables.init(module.exports.query, function (err) { if (err) {