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
committed by Magesh K
parent 7dfbba9b00
commit d560e14423
2 changed files with 5 additions and 5 deletions

View File

@@ -2068,7 +2068,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 unableToConnectSideJIT
case unableToRespondSideJITDevice
@@ -53,8 +53,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 unableToConnectSideJIT: OperationError = .init(code: .unableToConnectSideJIT)
static let unableToRespondSideJITDevice: OperationError = .init(code: .unableToRespondSideJITDevice)
@@ -167,7 +168,6 @@ struct OperationError: ALTLocalizedError {
failureReason += " (\(sourceFile) line \(sourceLine)"
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("SideStore could not determine this device's UDID.", comment: "")