Skip to content

Commit

Permalink
Don't send mach diagnostics as title, let the server figure it out. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
matux authored Feb 28, 2023
1 parent 6560730 commit 4ca6014
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,12 @@ public class RollbarCrashDiagnosticFilter: NSObject, KSCrashReportFilter {
: diagnostic
}

let error = report.crash.error
let machDiagnostics = zip(
error?.address, error?.mach, error?.signal
).map { (address, mach, signal) in
[Diagnostic("\(mach.exceptionName) (\(signal.signalName))", source: "Exception Type"),
Diagnostic("\(mach.codeName) at \(address)", source: "Exception Subtype")]
} ?? []

let diagnostic = kscrashDiagnostics.first
?? dyldDiagnostics.first(where: { $0.source != "libsystem_sim_platform.dylib" })
?? machDiagnostics.first(where: { $0.source == "Exception Type" })

var diagnosedReport = report
diagnosedReport.crash.diagnosis = diagnostic?.diagnosis
diagnosedReport.crash.diagnostics = kscrashDiagnostics + dyldDiagnostics + machDiagnostics
diagnosedReport.crash.diagnostics = kscrashDiagnostics + dyldDiagnostics
return .success(diagnosedReport)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ - (RollbarServer *)buildRollbarServer {
return self.osData;
}

- (nonnull NSString *)messageFromCrashReport:(nonnull NSString *)report {
- (nullable NSString *)messageFromCrashReport:(nonnull NSString *)report {
NSRange range = [report rangeOfString:@"Rollbar Diagnosis: "];
if (range.length != 0) {
NSRange lineRange = [report lineRangeForRange:range];
Expand All @@ -310,7 +310,7 @@ - (nonnull NSString *)messageFromCrashReport:(nonnull NSString *)report {
return diagnosis;
}

return @"Undiagnosed crash";
return nil;
}

@end

0 comments on commit 4ca6014

Please sign in to comment.