diff --git a/Mac/ErrorHandler.swift b/Mac/ErrorHandler.swift index f0258a7e2..018da1a63 100644 --- a/Mac/ErrorHandler.swift +++ b/Mac/ErrorHandler.swift @@ -8,11 +8,18 @@ import AppKit import Account +import os.log struct ErrorHandler { + private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Account") + public static func present(_ error: Error) { NSApplication.shared.presentError(error) } + public static func log(_ error: Error) { + os_log(.error, log: self.log, "%@", error.localizedDescription) + } + } diff --git a/Shared/Timer/AccountRefreshTimer.swift b/Shared/Timer/AccountRefreshTimer.swift index 8a5af89ba..15a6acda8 100644 --- a/Shared/Timer/AccountRefreshTimer.swift +++ b/Shared/Timer/AccountRefreshTimer.swift @@ -73,7 +73,7 @@ class AccountRefreshTimer { lastTimedRefresh = Date() update() - AccountManager.shared.refreshAll(errorHandler: ErrorHandler.present) + AccountManager.shared.refreshAll(errorHandler: ErrorHandler.log) }