mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 08:17:16 +00:00
33 lines
658 B
Swift
33 lines
658 B
Swift
//
|
|
// CloudKitError.swift
|
|
// RSCore
|
|
//
|
|
// Created by Maurice Parker on 3/26/20.
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import CloudKit
|
|
|
|
public final class CloudKitError: LocalizedError, Sendable {
|
|
|
|
public let error: Error
|
|
|
|
public init(_ error: Error) {
|
|
self.error = error
|
|
}
|
|
|
|
public var errorDescription: String? {
|
|
guard let ckError = error as? CKError else {
|
|
return error.localizedDescription
|
|
}
|
|
|
|
let description = ckError.localizedDescription
|
|
if let failureReason = (ckError as NSError).localizedFailureReason {
|
|
return "\(description): \(failureReason)"
|
|
}
|
|
return description
|
|
}
|
|
|
|
}
|