From c61d2fb97a11a5e727927d54160f372d6fa6efdf Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 12 Mar 2026 20:53:59 -0700 Subject: [PATCH] Add operation and other data to error log. --- .../Account/ReaderAPI/ReaderAPIAccountDelegate.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index 7ee2f1071..24ce6dc15 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -266,7 +266,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate { } catch { refreshProgress.completeTask() Self.logger.error("ReaderAPIAccountDelegate: removeFolder — remove feed 1 error: \(error.localizedDescription)") - postSyncError(error, account: account) + postSyncError(error, account: account, operation: "Removing feed from folder") } } @@ -282,7 +282,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate { refreshProgress.completeTask() Self.logger.error("ReaderAPIAccountDelegate: removeFolder - remove feed 2 error: \(error.localizedDescription)") - postSyncError(error, account: account) + postSyncError(error, account: account, operation: "Removing feed from folder") } } } @@ -460,7 +460,7 @@ final class ReaderAPIAccountDelegate: AccountDelegate { try await restoreFeed(for: account, feed: feed, container: folder) } catch { Self.logger.error("ReaderAPIAccountDelegate: restoreFolder — error: \(error.localizedDescription)") - postSyncError(error, account: account) + postSyncError(error, account: account, operation: "Restoring feed to folder") } } @@ -825,7 +825,7 @@ private extension ReaderAPIAccountDelegate { await processEntries(account: account, entries: entries) } catch { Self.logger.error("ReaderAPI: Refresh missing articles error: \(error.localizedDescription)") - postSyncError(error, account: account) + postSyncError(error, account: account, operation: "Refreshing missing articles") } } @@ -944,8 +944,8 @@ private extension ReaderAPIAccountDelegate { } } - func postSyncError(_ error: Error, account: Account) { - let errorLogUserInfo = ErrorLogUserInfoKey.userInfo(sourceName: account.nameForDisplay, sourceID: account.type.rawValue, errorMessage: error.localizedDescription) + func postSyncError(_ error: Error, account: Account, operation: String, fileName: String = #fileID, functionName: String = #function, lineNumber: Int = #line) { + let errorLogUserInfo = ErrorLogUserInfoKey.userInfo(sourceName: account.nameForDisplay, sourceID: account.type.rawValue, operation: operation, errorMessage: error.localizedDescription, fileName: fileName, functionName: functionName, lineNumber: lineNumber) NotificationCenter.default.post(name: .appDidEncounterError, object: self, userInfo: errorLogUserInfo) } }