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

Error handling for delete() #28

Open
Rumyra opened this issue Aug 5, 2020 · 2 comments
Open

Error handling for delete() #28

Rumyra opened this issue Aug 5, 2020 · 2 comments

Comments

@Rumyra
Copy link

Rumyra commented Aug 5, 2020

Currently there is no feedback if the id passed into the delete method doesn't exist in the Content Index.

I'm unsure of what type of exception this should throw, but doing something like:

try {
	registration.index.delete("something");
} catch (e) {
	console.log('Failed to remove content', e.message);
}

would be good programming™️

@rayankans
Copy link
Collaborator

It might be better to have the promise resolve to true/false depending on whether something was deleted, to match the CacheStorage API.

@Rumyra
Copy link
Author

Rumyra commented Aug 6, 2020

Yeh that sounds like a good idea to me.

I do realise good programming™️ would be making sure the id existed within the index before removing it, but I can't help but think having something return would be beneficial.

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

2 participants