doSomeDatabaseWork().then(function(){
// Success
}).catch(Dexie.UpgradeError, function (e) {
// Failed with UpgradeError
console.error ("Upgrade error: " + e.message);
}).catch(Error, function (e) {
// Any other error derived from standard Error
console.error ("Error: " + e.message);
}).catch(function (e) {
// Other error such as a string was thrown
console.error (e);
});