Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
make sure we catch errors connecting to mongodb due to wrongly suppli…
Browse files Browse the repository at this point in the history
…ed connection string or others, and show an error
  • Loading branch information
lirantal committed Nov 30, 2014
1 parent 75c40bd commit 9c25722
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var db = mongoose.connect(config.db.uri, config.db.options, function(err) {
console.log(chalk.red(err));
}
});
mongoose.connection.on('error', console.error.bind(console, chalk.red('MongoDB connection error:')));

// Init the express application
var app = require('./config/express')(db);
Expand Down

0 comments on commit 9c25722

Please sign in to comment.