Replaces OperationError.cancelled with CancellationError

Keeps `OperationError.cancelled` around for source-compatibility, but now returns CancellationError() instead of OperationError.
This commit is contained in:
Riley Testut
2023-05-11 17:15:33 -05:00
parent ad41024bcb
commit 10ac6507ec
2 changed files with 4 additions and 4 deletions

View File

@@ -1872,7 +1872,7 @@ private extension AppManager
{
switch error
{
case ~OperationError.Code.cancelled: return // Don't log OperationError.cancelled
case is CancellationError: return // Don't log CancellationErrors
default: break
}

View File

@@ -19,7 +19,7 @@ extension OperationError
/* General */
case unknown = 1000
case unknownResult = 1001
case cancelled = 1002
// case cancelled = 1002
case timedOut = 1003
case notAuthenticated = 1004
case appNotFound = 1005
@@ -38,8 +38,9 @@ extension OperationError
case connectionDropped = 1202
}
static var cancelled: CancellationError { CancellationError() }
static let unknownResult: OperationError = .init(code: .unknownResult)
static let cancelled: OperationError = .init(code: .cancelled)
static let timedOut: OperationError = .init(code: .timedOut)
static let notAuthenticated: OperationError = .init(code: .notAuthenticated)
static let unknownUDID: OperationError = .init(code: .unknownUDID)
@@ -108,7 +109,6 @@ struct OperationError: ALTLocalizedError
return failureReason
case .unknownResult: return NSLocalizedString("The operation returned an unknown result.", comment: "")
case .cancelled: return NSLocalizedString("The operation was cancelled.", comment: "")
case .timedOut: return NSLocalizedString("The operation timed out.", comment: "")
case .notAuthenticated: return NSLocalizedString("You are not signed in.", comment: "")
case .unknownUDID: return NSLocalizedString("AltStore could not determine this device's UDID.", comment: "")