[Both] Improves error messages

This commit is contained in:
Riley Testut
2020-03-11 13:35:14 -07:00
parent 4f00018164
commit 5e25593c3d
6 changed files with 141 additions and 43 deletions

View File

@@ -0,0 +1,18 @@
//
// NSError+LocalizedFailure.swift
// AltStore
//
// Created by Riley Testut on 3/11/20.
// Copyright © 2020 Riley Testut. All rights reserved.
//
import Foundation
extension NSError
{
@objc(alt_localizedFailure)
var localizedFailure: String? {
let localizedFailure = (self.userInfo[NSLocalizedFailureErrorKey] as? String) ?? (NSError.userInfoValueProvider(forDomain: self.domain)?(self, NSLocalizedFailureErrorKey) as? String)
return localizedFailure
}
}