Skip to content

Commit

Permalink
Fix internal error grouping hash on iOS 15
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Nov 3, 2021
1 parent 1a3fa39 commit dc539a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Bugsnag/Delivery/BSGEventUploadKSCrashReportOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ static void ReportInternalError(NSString *errorClass, NSString *message, NSDicti
// offsets which would lead to some types of errors not being grouped at all; e.g.
// - "Invalid value around character 229194."
// - "No string key for value in object around character 94208."
// - "No string key for value in object around line 1, column 161315." (iOS 15+)
// - "Unable to convert data to string around character 158259."
// - "Unterminated string around character 22568."
//
NSString *groupingMessage = [message componentsSeparatedByString:@" around character "].firstObject;
NSString *groupingMessage = message;
for (NSString *separator in @[@" around character ", @" around line"]) {
if ([message containsString:separator]) {
groupingMessage = [message componentsSeparatedByString:separator].firstObject;
break;
}
}
NSString *groupingHash = [NSString stringWithFormat:@"BSGEventUploadKSCrashReportOperation.m: %@: %@", errorClass, groupingMessage];
[BSGInternalErrorReporter.sharedInstance reportErrorWithClass:errorClass message:message diagnostics:diagnostics groupingHash:groupingHash];
}
Expand Down

0 comments on commit dc539a1

Please sign in to comment.