From 9c4f13e6cd296994ab6054151db0a0bb298f261b Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Thu, 6 Feb 2014 14:13:59 +0900 Subject: [PATCH] Be more obvious when the database connection fails. --- lib/db/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/db/index.js b/lib/db/index.js index 06f8cecf..5a77c072 100644 --- a/lib/db/index.js +++ b/lib/db/index.js @@ -17,6 +17,10 @@ function connect() { }) return setup(conn) }) + .catch(function(err) { + log.fatal('Unable to connect to the database: "%s"', err.message) + process.exit(1) + }) } var db = module.exports = Object.create(null)