Flutterfire: [cloud_firestore] PlatformException is totally different for iOS and Android

Created on 28 Oct 2019  路  2Comments  路  Source: FirebaseExtended/flutterfire

Describe the bug

Exactly the same code running on exactly the same document in the Cloud Firestore on two platforms throws two completely different exceptions:

iOS: PlatformException(Error 7, FIRFirestoreErrorDomain, Missing or insufficient permissions.)
Android: PlatformException(Error performing get, PERMISSION_DENIED: Missing or insufficient permissions., null)

This document is protected by the security rule and I do expect the get() call to error out, but I didn't expect to deal with completely different errors.

To Reproduce
Steps to reproduce the behavior:
Call document.get() on the document protected by the security rule.

Expected behavior
I'd expect at least PlatformException.code to be the same on both platforms.

cloud_firestore 0.12.9+5 Flutter 1.9.1 (stable)

crowd cloud_firestore bug

Most helpful comment

PlatformException.code for the FlutterFire plugins have any documentation about? I lost a lot of time to discover every PlatformException.code and PlatformException.message variation.

All 2 comments

PlatformException.code for the FlutterFire plugins have any documentation about? I lost a lot of time to discover every PlatformException.code and PlatformException.message variation.

Let's consolidate this under #1223 - will close this one - thanks

Was this page helpful?
0 / 5 - 0 ratings