-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
No error returned during a callback on localForage.getItem #14
Comments
I think I guess right when I presume that the reason there are no errors returned is because According to the spec at http://www.w3.org/TR/webstorage/#storage-0 if we read a key that doesn't exist, we should get a null value. If writing fails, the most it can happen is a Not sure how to proceed about exceptions with an async interface. I guess it's saner to switch to the |
We can certainly add failure callbacks (and promise rejections, when they make it into master), but I don't expect reading unset keys to fail, I personally do expect them to just return Like @sole says too: there aren't really errors that should bubble up unless there's something wrong with the storage engine itself; getting and setting data, aside from hitting the quota, shouldn't ever cause errors. |
I think this should be covered by #60, so I'll close this for now. |
I noticed that localForage.getItem only returns a value if it is successful but never if there is an error. Generally I would expect the following behaviour:
Although localStorage doesn't return callbacks, it seems like the indexedDB part should at least return something if it were to go wrong so that users can handle the result accordingly.
The text was updated successfully, but these errors were encountered: