Fix for unhandled promise on fresh db startup

issue #977

- As of the addition of when/monitor/console we now get errors about unhandled promises
- This fixes one which appeared when starting up without a DB
This commit is contained in:
Hannah Wolfe 2013-10-09 16:58:50 +01:00
parent 53dc1b4466
commit b5c5d531d1

View File

@ -54,7 +54,7 @@ function getDatabaseVersion() {
return databaseVersion;
});
}
return when.reject('Settings table does not exist');
throw new Error('Settings table does not exist');
});
}
@ -99,7 +99,7 @@ module.exports = {
}
}, function (err) {
if (err === 'Settings table does not exist') {
if (err.message || err === 'Settings table does not exist') {
// 4. The database has not yet been created
// Bring everything up from initial version.
return self.migrateUpFreshDb();