if there are issues connecting to mongo, db.migrationCollection is still called. When db.getConnection fails to get a connection, db is undefined and this exception is raised:
~/mongo-migrate/index.js:247
var migrationCollection = db.migrationCollection,
^
TypeError: Cannot read property 'migrationCollection' of undefined
Moving error conditional up, so that an error is logged instead.
if there are issues connecting to mongo, db.migrationCollection is still called. When db.getConnection fails to get a connection, db is undefined and this exception is raised:
~/mongo-migrate/index.js:247 var migrationCollection = db.migrationCollection, ^ TypeError: Cannot read property 'migrationCollection' of undefined
Moving error conditional up, so that an error is logged instead.