Skip to content

Commit 056f45c

Browse files
fix: update exception handling iOS
1 parent f66838f commit 056f45c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/firestore/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,12 @@ - (void)invalidate {
246246
[aggregateFields addObject:[FIRAggregateField aggregateFieldForAverageOfField:fieldPath]];
247247
} else {
248248
NSString *reason = [@"Invalid Aggregate Type: " stringByAppendingString:aggregateType];
249-
@throw [NSException exceptionWithName:@"RNFB Firestore: Invalid Aggregate Type"
250-
reason:reason
251-
userInfo:nil];
249+
[RNFBFirestoreCommon
250+
promiseRejectFirestoreException:reject
251+
error:[NSException exceptionWithName:
252+
@"RNFB Firestore: Invalid Aggregate Type"
253+
reason:reason
254+
userInfo:nil]];
252255
}
253256
}
254257

0 commit comments

Comments
 (0)