mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add account name to network error messages and prevent background iOS errors from displaying alerts
This commit is contained in:
25
iOS/ErrorHandler.swift
Normal file
25
iOS/ErrorHandler.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// ErrorHandler.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 5/26/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import RSCore
|
||||
import os.log
|
||||
|
||||
struct ErrorHandler {
|
||||
|
||||
private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Account")
|
||||
|
||||
public static func present(_ error: Error) {
|
||||
UIApplication.shared.presentError(error)
|
||||
}
|
||||
|
||||
public static func log(_ error: Error) {
|
||||
os_log(.error, log: self.log, "%@", error.localizedDescription)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user