Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send mach diagnostics as title, let the server figure it out. #265

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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