mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-18 19:23:43 +01:00
Renames ALTLocalizedError.errorFailure to failure
Better matches LocalizedError’s failureReason, recoverySuggestion, and helpAnchor naming.
This commit is contained in:
@@ -38,7 +38,7 @@ struct BackupError: ALTLocalizedError
|
|||||||
let sourceFile: String
|
let sourceFile: String
|
||||||
let sourceFileLine: Int
|
let sourceFileLine: Int
|
||||||
|
|
||||||
var errorFailure: String?
|
var failure: String?
|
||||||
|
|
||||||
var failureReason: String? {
|
var failureReason: String? {
|
||||||
switch self.code
|
switch self.code
|
||||||
@@ -60,7 +60,7 @@ struct BackupError: ALTLocalizedError
|
|||||||
var errorUserInfo: [String : Any] {
|
var errorUserInfo: [String : Any] {
|
||||||
let userInfo: [String: Any?] = [NSLocalizedDescriptionKey: self.errorDescription,
|
let userInfo: [String: Any?] = [NSLocalizedDescriptionKey: self.errorDescription,
|
||||||
NSLocalizedFailureReasonErrorKey: self.failureReason,
|
NSLocalizedFailureReasonErrorKey: self.failureReason,
|
||||||
NSLocalizedFailureErrorKey: self.errorFailure,
|
NSLocalizedFailureErrorKey: self.failure,
|
||||||
ErrorUserInfoKey.sourceFile: self.sourceFile,
|
ErrorUserInfoKey.sourceFile: self.sourceFile,
|
||||||
ErrorUserInfoKey.sourceFileLine: self.sourceFileLine]
|
ErrorUserInfoKey.sourceFileLine: self.sourceFileLine]
|
||||||
return userInfo.compactMapValues { $0 }
|
return userInfo.compactMapValues { $0 }
|
||||||
@@ -69,7 +69,7 @@ struct BackupError: ALTLocalizedError
|
|||||||
init(_ code: Code, description: String? = nil, file: String = #file, line: Int = #line)
|
init(_ code: Code, description: String? = nil, file: String = #file, line: Int = #line)
|
||||||
{
|
{
|
||||||
self.code = code
|
self.code = code
|
||||||
self.errorFailure = description
|
self.failure = description
|
||||||
self.sourceFile = file
|
self.sourceFile = file
|
||||||
self.sourceFileLine = line
|
self.sourceFileLine = line
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ extension NSError
|
|||||||
|
|
||||||
protocol ALTLocalizedError: LocalizedError, CustomNSError
|
protocol ALTLocalizedError: LocalizedError, CustomNSError
|
||||||
{
|
{
|
||||||
var errorFailure: String? { get }
|
var failure: String? { get }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ALTLocalizedError
|
extension ALTLocalizedError
|
||||||
@@ -54,7 +54,7 @@ extension ALTLocalizedError
|
|||||||
var errorUserInfo: [String : Any] {
|
var errorUserInfo: [String : Any] {
|
||||||
let userInfo = [NSLocalizedDescriptionKey: self.errorDescription,
|
let userInfo = [NSLocalizedDescriptionKey: self.errorDescription,
|
||||||
NSLocalizedFailureReasonErrorKey: self.failureReason,
|
NSLocalizedFailureReasonErrorKey: self.failureReason,
|
||||||
NSLocalizedFailureErrorKey: self.errorFailure].compactMapValues { $0 }
|
NSLocalizedFailureErrorKey: self.failure].compactMapValues { $0 }
|
||||||
return userInfo
|
return userInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ enum VerificationError: ALTLocalizedError
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorFailure: String? {
|
var failure: String? {
|
||||||
return String(format: NSLocalizedString("“%@” could not be installed.", comment: ""), app.name)
|
return String(format: NSLocalizedString("“%@” could not be installed.", comment: ""), app.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user