Skip to content

Commit

Permalink
Catch connection initialization errors
Browse files Browse the repository at this point in the history
This catches database connection initialization errors.

Fixes #1037
  • Loading branch information
IamRaviTejaG committed Oct 5, 2018
1 parent 815ffe6 commit dfdd52f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = function (app) {

const dbName = parse(config, () => {});
return client.db(dbName);
}).catch(error => {
console.error(error);
});

app.set('mongoClient', promise);
Expand Down

0 comments on commit dfdd52f

Please sign in to comment.