Skip to content

Commit

Permalink
Fix MONGODB_URI reference in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Sep 27, 2020
1 parent 0670c5a commit 4ba636d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/storage/mongo-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ function init (env, cb, forceNewConnection) {
.catch(err => {
if (err.message && err.message.includes('AuthenticationFailed')) {
console.log('Authentication to Mongo failed');
cb(new Error('MongoDB authentication failed! Double check the URL has the right username and password in MONGO_CONNECTION.'), null);
cb(new Error('MongoDB authentication failed! Double check the URL has the right username and password in MONGODB_URI.'), null);
return;
}

if (err.name && err.name === "MongoNetworkError") {
var timeout = (i > 15) ? 60000 : i * 3000;
console.log('Error connecting to MongoDB: %j - retrying in ' + timeout / 1000 + ' sec', err);
setTimeout(connect_with_retry, timeout, i + 1);
if (i == 1) cb(new Error('MongoDB authentication failed! Double check the MONGO_CONNECTION setting in Heroku.'), null);
if (i == 1) cb(new Error('MongoDB connection failed! Double check the MONGODB_URI setting in Heroku.'), null);
} else {
cb(new Error('MONGODB_URI ' + env.storageURI + ' seems invalid: ' + err.message));
}
Expand Down

0 comments on commit 4ba636d

Please sign in to comment.