Skip to content

Commit

Permalink
Use recordExceptionModel instead of recordError
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-op committed Apr 14, 2020
1 parent e551f90 commit 2f337ad
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,14 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
if (context != nil) {
reason = [NSString stringWithFormat:@"thrown %@", context];
}
NSDictionary *stack = @{
@"stackTrace" : frames
};

NSException *exception = [NSException
exceptionWithName:call.arguments[@"exception"]
reason:reason
userInfo:stack];
FIRExceptionModel *exception = [FIRExceptionModel
exceptionModelWithName:call.arguments[@"exception"]
reason:reason];

exception.setStackTrace = frames;

[[FIRCrashlytics crashlytics] recordError:exception];
[[FIRCrashlytics crashlytics] recordExceptionModel:exception];
result(@"Error reported to Crashlytics.");
} else if ([@"Crashlytics#setUserIdentifier" isEqualToString:call.method]) {
[[FIRCrashlytics crashlytics] setUserID:call.arguments[@"identifier"]];
Expand Down

0 comments on commit 2f337ad

Please sign in to comment.