cannot handle error from useFirestoreCollectionData
See original GitHub issueVersion info
React: 18.2.0
Firebase: 9.9.0
ReactFire: 4.2.2
Other (e.g. Node, browser, operating system) (if applicable): Next.js 12.2.2
Test case
use useFirestoreCollectionData
and handle FirebaseError: Missing or insufficient permissions.
Steps to reproduce
- Set permissions in firebase console and set a rule that doesn’t allow the query for a user
- Make the query
const { status, data: users, error } = useFirestoreCollectionData(usersQuery);
Expected behavior
The hook doesn’t throw and the error is in error
variable
Actual behavior
The hook throws and error cannot be handled without try catch (that should’t be used?) https://github.com/FirebaseExtended/reactfire/blob/9754f8690389feaa1a7a65348aab1567857bca72/src/useObservable.ts#L120-L134
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Missing permissions error message right after login
I will have to find a way to handle auto signOut if not loggedIn while on a secured page. But from what I...
Read more >Handle errors for Cloud Storage on Web - Firebase
Handle Error Messages ; storage/cannot-slice-blob, Commonly occurs when the local file has changed (deleted, saved again, etc.). Try uploading again after ...
Read more >Handle Firestore watch listener errors | Google Cloud
listenErrors demonstrates how to handle listening errors. func listenErrors(ctx context.Context, w io.Writer, projectID, collection string) error {
Read more >Error handling | Open Spherical Camera API
"code": "serverError", "message": "cannot get camera info." }
Read more >Handle errors for Cloud Storage on Fluttter - FlutterFire
When in doubt, catch the exception thrown by the function and see what the error message has to say. final storageRef = FirebaseStorage.instance....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
tagging @jhuleatt to hopefully increase visibility
same