Exit on database connection failure

This commit is contained in:
Lamp 2018-10-15 17:34:09 -07:00 committed by GitHub
parent e95d4ad5e2
commit b5c56de3bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -35,7 +35,13 @@ dbClient.connect().then(function(){
global.mdbClient = client;
console.log("Connecting to Discord…");
dClient.login(config.DISCORD_TOKEN);
}, function(err){
console.error("Failed to connect to MongoDB:\n", err.stack);
process.exit(1);
});
}, function(err){
console.error("Failed to connect to Postgres:\n", err.stack);
process.exit(1);
});
dClient.once('ready', () => {