Skip to content

Dexie.VersionChangeError

David Fahlander edited this page Mar 14, 2016 · 6 revisions

Inheritance Hierarchy

Description

Happens when a db operation has failed due to that database couldn't be opened.

Sample using Promise.catch()

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

Sample: switch(error.name)

db.on('error', function (error) {
    switch (error.name) {
        case Dexie.errnames.VersionChange:
            console.log ("open failed");
            break;
        default:
            console.log ("error: " + e.message);
    }
});

Properties

name Will always be Dexie.errnames.VersionChange === "VersionChangeError"
message Detailed message
inner? Inner exception instance (if any)
stack Can be present if the error was thown. If signaled, there wont be any call stack.
Clone this wiki locally