From 65b3f1dbc83ed9ead5cfee495926e1bdede83dcb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 12 Mar 2026 21:47:18 -0700 Subject: [PATCH] Add logging for feed parser errors. --- .../LocalAccount/LocalAccountRefresher.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift index a23d86b15..fb04907d8 100644 --- a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift +++ b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift @@ -168,7 +168,18 @@ import os Self.logger.debug("LocalAccountRefresher: parsing feed for \(url.absoluteString)") let parserData = ParserData(url: feed.url, data: data) - guard let parsedFeed = try? await FeedParser.parse(parserData) else { + let parsedFeed: ParsedFeed + do { + guard let result = try await FeedParser.parse(parserData) else { + return + } + parsedFeed = result + } catch { + Self.logger.error("LocalAccountRefresher: feed parse error for \(url.absoluteString): \(error.localizedDescription)") + if let account = feed.account { + let errorLogUserInfo = ErrorLogUserInfoKey.userInfo(sourceName: account.nameForDisplay, sourceID: account.type.rawValue, operation: "Parsing feed", errorMessage: "\(error.localizedDescription): \(url.absoluteString)") + NotificationCenter.default.post(name: .appDidEncounterError, object: self, userInfo: errorLogUserInfo) + } return } guard let account = feed.account else {