mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
[Both] Improves error messages
This commit is contained in:
18
AltStore/Extensions/NSError+LocalizedFailure.swift
Normal file
18
AltStore/Extensions/NSError+LocalizedFailure.swift
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user