🐛 [cloud_firestore] Helpful error message is lost #12045
Labels
platform: all
Issues / PRs which are for all platforms.
plugin: cloud_firestore
type: bug
Something isn't working
type: enhancement
New feature or request
Bug report
Describe the bug
The Firestore SDKs will usually provide a helpful error text alongside error code. This text is often generated by the Firestore server, and contains more information, specific to the situation that caused the error.
The problem is that FlutterFire will overwrite these error texts with the standard text, that doesn't include any situation specific help.
See code locations:
https://github.com/firebase/flutterfire/blob/a1363b02fdb12602df535f12bf875f85857524a5/packages/cloud_firestore/cloud_firestore/ios/Classes/FLTFirebaseFirestoreUtils.m
https://github.com/firebase/flutterfire/blob/a1363b02fdb12602df535f12bf875f85857524a5/packages/cloud_firestore/cloud_firestore/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestoreException.java
https://github.com/firebase/flutterfire/blob/a1363b02fdb12602df535f12bf875f85857524a5/packages/cloud_firestore/cloud_firestore/macos/Classes/FLTFirebaseFirestoreUtils.m
Consequently, a customer will receive error:
UNAVAILABLE - The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations.
Instead of a helpful error, such as:
UNAVAILABLE - Failed to get document because the client is offline.
or
UNAVAILABLE - Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to SERVER to retrieve the cached document.
See a recent support request: firebase/firebase-ios-sdk#12153
Having more information in error message will go a long way to help these customers better.
The text was updated successfully, but these errors were encountered: