From 6492554cf17c67c1b778504ca1e033820a5b66ff Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 23 Oct 2015 12:19:51 -0500 Subject: [PATCH] Add error handling for when mongo is not running. --- tasks/gulp-tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index 091c5fd5bd..64de69f135 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -37,7 +37,8 @@ let testBin = (string) => { }; gulp.task('test:prepare:mongo', (cb) => { - mongoose.connect(TEST_DB_URI, () => { + mongoose.connect(TEST_DB_URI, (err) => { + if (err) return cb(`Unable to connect to mongo database. Are you sure it's running? \n\n${err}`); mongoose.connection.db.dropDatabase(); mongoose.connection.close(); cb();