Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to catch abort if the capacity of storage is full?? #685

Open
ozaryo opened this issue Sep 15, 2021 · 0 comments
Open

How to catch abort if the capacity of storage is full?? #685

ozaryo opened this issue Sep 15, 2021 · 0 comments

Comments

@ozaryo
Copy link

ozaryo commented Sep 15, 2021

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.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant