Skip to content

Commit ff406b7

Browse files
committed
Use recordExceptionModel instead of recordError
1 parent 422353b commit ff406b7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,14 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
8181
if (context != nil) {
8282
reason = [NSString stringWithFormat:@"thrown %@", context];
8383
}
84-
NSDictionary *stack = @{
85-
@"stackTrace" : frames
86-
};
8784

88-
NSException *exception = [NSException
89-
exceptionWithName:call.arguments[@"exception"]
90-
reason:reason
91-
userInfo:stack];
85+
FIRExceptionModel *exception = [FIRExceptionModel
86+
exceptionModelWithName:call.arguments[@"exception"]
87+
reason:reason];
88+
89+
exception.stackTrace = frames;
9290

93-
[[FIRCrashlytics crashlytics] recordError:exception];
91+
[[FIRCrashlytics crashlytics] recordExceptionModel:exception];
9492
result(@"Error reported to Crashlytics.");
9593
} else if ([@"Crashlytics#setUserIdentifier" isEqualToString:call.method]) {
9694
[[FIRCrashlytics crashlytics] setUserID:call.arguments[@"identifier"]];

0 commit comments

Comments
 (0)