nedb
nedb copied to clipboard
How to catch abort if the capacity of storage is full??
I want to catch the abort if storage is full and it can't insert or update data. but this library can't catch abort. When I try to insert data if capacity of storage is full, it doesn't insert data in indexDB.
please tell me how to catch abort.
I try this code but "err" is null.
async insert(argTableName: string, obj: any): Promise
{ await this.open(argTableName); return new Promise ((resolve, reject) => { LocalDatabaseService.m_any_database[argTableName].insert(obj, (err, newDocs) => { if (!err) { if (newDocs.length === obj.length) { console.log("Sucess=" + newDocs.length); return resolve(newDocs.length); } } return reject(-1); }); }); }
it has already opened DB and create NeDb instance.
- LocalDatabaseService.m_any_database[argTableName] is NeDb instance.
Browser :Chrome.