mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-11 08:56:54 +01:00
673f0ce718
If a single sync failure is encountered a sheet is presented which allows the user to update their credentials. If multiple sync failures are encountered an alert is shown listing the accounts which encountered errors. On iOS, this alert can take the user into Settings, but there is no obvious way to programatically pesent macOS preferences.
30 lines
697 B
Swift
30 lines
697 B
Swift
//
|
|
// AccountSyncError.swift
|
|
// Account
|
|
//
|
|
// Created by Stuart Breckenridge on 24/7/20.
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import os.log
|
|
|
|
public extension Notification.Name {
|
|
static let AccountsDidFailToSyncWithErrors = Notification.Name("AccountsDidFailToSyncWithErrors")
|
|
}
|
|
|
|
public struct AccountSyncError {
|
|
|
|
private static let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
|
|
public let account: Account
|
|
public let error: Error
|
|
|
|
init(account: Account, error: Error) {
|
|
self.account = account
|
|
self.error = error
|
|
os_log(.error, log: AccountSyncError.log, "%@", error.localizedDescription)
|
|
}
|
|
|
|
}
|
|
|