Skip to content

Commit

Permalink
fix(cloud_firestore): propagate COLLECTION_GROUP_ASC index error mess…
Browse files Browse the repository at this point in the history
…age (#10130)

* fix: propagate native error message

* respect ASC index for collection group query

Co-authored-by: Russell Wheatley <russellwheatley85@gmail.com>
  • Loading branch information
lesnitsky and russellwheatley committed Dec 22, 2022
1 parent 4289881 commit 6b321cb
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -101,7 +101,8 @@ + (NSArray *)ErrorCodeAndMessageFromNSError:(NSError *)error {
case FIRFirestoreErrorCodeFailedPrecondition:
code = @"failed-precondition";
if ([error.localizedDescription containsString:@"query requires an index"] ||
[error.localizedDescription containsString:@"requires a COLLECTION_GROUP_DESC index"]) {
[error.localizedDescription containsString:@"requires a COLLECTION_GROUP_DESC index"] ||
[error.localizedDescription containsString:@"requires a COLLECTION_GROUP_ASC index"]) {
message = error.localizedDescription;
} else {
message = @"Operation was rejected because the system is not in a state required for the "
Expand Down

0 comments on commit 6b321cb

Please sign in to comment.