From e8199ed0a679b197aa367ea4d56fa7508b7c0f5f Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 10 Jun 2019 15:21:17 -0500 Subject: [PATCH] Change to not show alert dialog on automatic refreshes. Issue #729 --- Mac/ErrorHandler.swift | 7 +++++++ Shared/Timer/AccountRefreshTimer.swift | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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) }