From 32b8d2794957d444d53a24815fa637bf4ddc0fb7 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 22 Jan 2024 17:05:03 -0500 Subject: [PATCH] Don't report network errors when syncing timeline marker --- Tusker/Screens/Timeline/TimelineViewController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index a4742f27..ef0212b9 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -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)