Skip to content

Commit 3650fbb

Browse files
authoredOct 3, 2017
Bug 1405131: Sentry logging for telmetry uploads (#3246)
Bug 1405131: Sentry logging for telemetry uploads
1 parent 540657b commit 3650fbb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ github "farhanpatel/JSONSchema.swift" "1c052b83baa8c497e12cde6a8afca0f54574612f"
1515
github "google/EarlGrey" "1.11.0"
1616
github "jhugman/SwiftRouter" "7b446fd063846ce2961b7518bb2386ffcbcc94d8"
1717
github "rs/SDWebImage" "4.1.0"
18-
github "mozilla-mobile/telemetry-ios" "ab7306fbff1a4b8e885dcc766d5f2d727f0d86f2"
18+
github "mozilla-mobile/telemetry-ios" "d0795178e4242d530b7adf4d8294ecae5d45e721"

‎Client/Telemetry/UnifiedTelemetry.swift

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import Telemetry
1010
//
1111
class UnifiedTelemetry {
1212
init(profile: Profile) {
13+
if AppConstants.BuildChannel == .beta {
14+
NotificationCenter.default.addObserver(self, selector: #selector(uploadError(notification:)), name: Telemetry.notificationUploadError, object: nil)
15+
}
16+
1317
let telemetryConfig = Telemetry.default.configuration
1418
telemetryConfig.appName = AppInfo.displayName
1519
telemetryConfig.userDefaultsSuiteName = AppInfo.sharedContainerIdentifier
@@ -28,5 +32,10 @@ class UnifiedTelemetry {
2832

2933
Telemetry.default.add(pingBuilderType: CorePingBuilder.self)
3034
}
35+
36+
@objc func uploadError(notification: NSNotification) {
37+
guard let error = notification.userInfo?["error"] as? NSError else { return }
38+
SentryIntegration.shared.send(message: error.localizedDescription, tag: "UnifiedTelemetry", severity: .info)
39+
}
3140
}
3241

0 commit comments

Comments
 (0)
Please sign in to comment.