Don't report network errors when syncing timeline marker

This commit is contained in:
Shadowfacts 2024-01-22 17:05:03 -05:00
parent fb5581ae67
commit 32b8d27949
1 changed files with 10 additions and 0 deletions

View File

@ -384,6 +384,11 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
_ = try await mastodonController.run(req)
} catch {
stateRestorationLogger.error("TimelineViewController: failed to update timeline marker: \(String(describing: error))")
if let error = error as? Client.Error,
case .networkError(_) = error.type {
return
}
let event = Event(error: error)
event.message = SentryMessage(formatted: "Failed to update timeline marker: \(String(describing: error))")
SentrySDK.capture(event: event)
@ -577,6 +582,11 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
return true
} catch {
stateRestorationLogger.error("TimelineViewController: failed to load from timeline marker: \(String(describing: error))")
if let error = error as? Client.Error,
case .networkError(_) = error.type {
return false
}
let event = Event(error: error)
event.message = SentryMessage(formatted: "Failed to load from timeline marker: \(String(describing: error))")
SentrySDK.capture(event: event)