2019-05-26 18:54:32 +02:00
|
|
|
//
|
|
|
|
// ErrorHandler.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 5/26/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import AppKit
|
|
|
|
import Account
|
2019-06-10 22:21:17 +02:00
|
|
|
import os.log
|
2019-05-26 18:54:32 +02:00
|
|
|
|
|
|
|
struct ErrorHandler {
|
|
|
|
|
2019-06-10 22:21:17 +02:00
|
|
|
private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Account")
|
|
|
|
|
2019-05-26 18:54:32 +02:00
|
|
|
public static func present(_ error: Error) {
|
|
|
|
NSApplication.shared.presentError(error)
|
|
|
|
}
|
|
|
|
|
2019-06-10 22:21:17 +02:00
|
|
|
public static func log(_ error: Error) {
|
|
|
|
os_log(.error, log: self.log, "%@", error.localizedDescription)
|
|
|
|
}
|
|
|
|
|
2019-05-26 18:54:32 +02:00
|
|
|
}
|