diff --git a/AltStore/Operations/ClearAppCacheOperation.swift b/AltStore/Operations/ClearAppCacheOperation.swift index ebe52acc..879858c1 100644 --- a/AltStore/Operations/ClearAppCacheOperation.swift +++ b/AltStore/Operations/ClearAppCacheOperation.swift @@ -79,8 +79,9 @@ class ClearAppCacheOperation: ResultOperation } else { - //let error = BatchError(errors: allErrors) - //self.finish(.failure(error)) + self.finish(.failure(OperationError.cacheClearError(errors: allErrors.map({ error in + return error.localizedDescription + })))) } } } @@ -121,8 +122,9 @@ private extension ClearAppCacheOperation if !errors.isEmpty { - //let error = BatchError(errors: errors) - //completion(.failure(error)) + completion(.failure(OperationError.cacheClearError(errors: errors.map({ error in + return error.localizedDescription + })))) } else { @@ -163,6 +165,7 @@ private extension ClearAppCacheOperation options: [.skipsSubdirectoryDescendants, .skipsHiddenFiles]) var errors = [Error]() + for backupDirectory in fileURLs { do @@ -185,8 +188,9 @@ private extension ClearAppCacheOperation if !errors.isEmpty { - //let error = BatchError(errors: errors) - //completion(.failure(error)) + completion(.failure(OperationError.cacheClearError(errors: errors.map({ error in + return error.localizedDescription + })))) } else { diff --git a/AltStore/Operations/OperationError.swift b/AltStore/Operations/OperationError.swift index 95cd1d28..4f33f6ed 100644 --- a/AltStore/Operations/OperationError.swift +++ b/AltStore/Operations/OperationError.swift @@ -40,6 +40,8 @@ enum OperationError: LocalizedError case provisioningError(result: String, message: String?) case anisetteV3Error(message: String) + case cacheClearError(errors: [String]) + var failureReason: String? { switch self { case .unknown: return NSLocalizedString("An unknown error occured.", comment: "") @@ -60,6 +62,7 @@ enum OperationError: LocalizedError case .anisetteV1Error(let message): return String(format: NSLocalizedString("An error occurred when getting anisette data from a V1 server: %@. Try using another anisette server.", comment: ""), message) case .provisioningError(let result, let message): return String(format: NSLocalizedString("An error occurred when provisioning: %@%@. Please try again. If the issue persists, report it on GitHub Issues!", comment: ""), result, message != nil ? (" (" + message! + ")") : "") case .anisetteV3Error(let message): return String(format: NSLocalizedString("An error occurred when getting anisette data from a V3 server: %@. Please try again. If the issue persists, report it on GitHub Issues!", comment: ""), message) + case .cacheClearError(let errors): return String(format: NSLocalizedString("An error occurred while clearing cache: %@", comment: ""), errors.joined(separator: "\n")) } } diff --git a/AltStore/Settings/Settings.storyboard b/AltStore/Settings/Settings.storyboard index 19910bd9..199d839c 100644 --- a/AltStore/Settings/Settings.storyboard +++ b/AltStore/Settings/Settings.storyboard @@ -359,22 +359,22 @@ -