[cloud_firestore] Have snapshots() method emit errors for devs to handle! #9260
Unanswered
sentd94
asked this question in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When listening to realtime updates of a collection, no errors / exceptions are emitted to the stream (for example if the client cannot get a connection to the server):
Why is this important?
Sometimes you need to differentiate if a collection currently has no documents OR the internet is down and therefore your snapshot is empty.
Note
For getting data just once using
get()
method there is agetOptions
parameter which you can use to enable error throwing (by passingGetOptions(source: Source.server)
). Forsnapshots()
you don't have that option.Beta Was this translation helpful? Give feedback.
All reactions