Dexie.DataCloneError

Inheritance Hierarchy

Description

An attempt to add or put an item into the database was made, where the object contained a strucure not supported by the Structured Cloning algorithm, such as a Function or Error object.

Sample using Promise.catch()

doSomeDatabaseWork().then(result => {
    // Success
}).catch('DataCloneError', e => {
    // Failed with DataCloneError
    console.error ("DataClone error: " + e.message);
}).catch(Error, e => {
    // Any other error derived from standard Error
    console.error ("Error: " + e.message);
}).catch(e => {
    // Other error such as a string was thrown
    console.error (e);
});

Sample: switch(error.name)

db.on('error', function (error) {
    switch (error.name) {
        // errnames.DataClone ==="DataCloneError"
        case Dexie.errnames.DataClone:
            console.error ("DataClone error");
            break;
        default:
            console.error ("error: " + e);
    }
});

Properties

nameWill always be Dexie.errnames.DataClone === "DataCloneError"
messageDetailed message
inner?Inner exception instance (if any)
stackCan be present if the error was thown. If signaled, there wont be any call stack.

Table of Contents