-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RxDocument.remove() throws on removal() when deleted #830
Comments
You are right. It schould return a rejected promise. |
Sending a PR your way tonight! |
Hi @rafamel I added the change so calling remove() will return a rejected promise. |
I agree with you @pubkey. Essentially, the rationale behind this was pure laziness. Aka, an async function will always return properly, and checking the whole codebase against it wasn't a sensible option time-wise. Ultimately, the only guarantee needs to be against the public api, so my approach would be to just check the functions susceptible of public use and ensure that they promise reject instead of throwing. It was quite a while ago, but I do remember I found a few public methods that didn't return properly (just like Thanks for the work, @pubkey ! |
Rx.Document.remove()
is throwing instead of promise-reject. Fromrx-document.js
:I haven't sent a PR as I'm thinking this might be intentional, but since it is an async method, I do think it should reject rather than throw.
The text was updated successfully, but these errors were encountered: