content-index
content-index copied to clipboard
Error handling for delete()
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™️
It might be better to have the promise resolve to true/false depending on whether something was deleted, to match the CacheStorage API.
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.