You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser version: Brave Version 1.33.106 Chromium: 96.0.4664.110 (Official Build) (64-bit)
Firebase SDK version: ^9.6.1
Firebase Product: firestore
Describe the problem
I'm trying to gracefully catch a "Missing or insufficient permissions." exception when accessing a document that I don't have access to due to specific security rules. The problem is that the SDK throw an error which looks like a FirebaseError but it isn't.
Here's the error in the browser debugger:
Even if it looks like a FirebaseError, error instanceof FirebaseError still returns false (see bellow).
I'm currently narrowing the type using the name property and compare with the string FirebaseError but this is not how it should work.
Steps to reproduce:
Try to access a Firestore document but the current rules disallow it. Catch the error and use a TypeScript type guard to narrow its type.
Uh oh!
There was an error while loading. Please reload this page.
Describe your environment
Describe the problem
I'm trying to gracefully catch a "Missing or insufficient permissions." exception when accessing a document that I don't have access to due to specific security rules. The problem is that the SDK throw an error which looks like a FirebaseError but it isn't.
Here's the error in the browser debugger:
Even if it looks like a FirebaseError,
error instanceof FirebaseError
still returnsfalse
(see bellow).I'm currently narrowing the type using the name property and compare with the string FirebaseError but this is not how it should work.
Steps to reproduce:
Try to access a Firestore document but the current rules disallow it. Catch the error and use a TypeScript type guard to narrow its type.
Relevant Code:
The line where I console.log() produces this:
The text was updated successfully, but these errors were encountered: