Inheritance Hierarchy


An index property (or primary key) was of the wrong type (not an indexable). This happens when:

  • …adding a new object to a table where its primary key is not an indexable type)
  • …querying by index, where the argument is not an indexable type)


const db = new Dexie('testdb');
    foo: 'id,bar'
});{id: null}); // fails with DataError because null is not indexable.{id: 1, bar: null}); // succeeds but fails silently to be indexed by "bar" index.'bar').equals(undefined).toArray(); // Fails with DataError as undefined is not indexable.

Sample using Promise.catch()

doSomeDatabaseWork().then(result => {
    // Success
}).catch('DataError', e => {
    // Failed with DataError
    console.error ("Data 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(

db.on('error', function (error) {
    switch ( {
        // errnames.Data ==="DataError"
        case Dexie.errnames.Data:
            console.error ("Data error");
            console.error ("error: " + e);


nameWill always be Dexie.errnames.Data === "DataError"
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