diff --git a/AltKit/CodableServerError.swift b/AltKit/CodableServerError.swift index 5dff7787..7ada01df 100644 --- a/AltKit/CodableServerError.swift +++ b/AltKit/CodableServerError.swift @@ -30,7 +30,13 @@ struct CodableServerError: Codable { self.errorCode = error.code - let userInfo = error.userInfo.compactMapValues { $0 as? String } + var userInfo = error.userInfo.compactMapValues { $0 as? String } + + if let localizedRecoverySuggestion = (error as NSError).localizedRecoverySuggestion + { + userInfo[NSLocalizedRecoverySuggestionErrorKey] = localizedRecoverySuggestion + } + if !userInfo.isEmpty { self.userInfo = userInfo diff --git a/AltKit/NSError+ALTServerError.m b/AltKit/NSError+ALTServerError.m index c82da672..3fdf5ad1 100644 --- a/AltKit/NSError+ALTServerError.m +++ b/AltKit/NSError+ALTServerError.m @@ -112,6 +112,9 @@ NSErrorUserInfoKey const ALTProvisioningProfileBundleIDErrorKey = @"bundleIdenti case ALTServerErrorPluginNotFound: return NSLocalizedString(@"Make sure Mail is running and the plug-in is enabled in Mail's preferences.", @""); + case ALTServerErrorMaximumFreeAppLimitReached: + return NSLocalizedString(@"Make sure “Offload Unused Apps” is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps.", @""); + default: return nil; } diff --git a/AltServer/AppDelegate.swift b/AltServer/AppDelegate.swift index 34a3790f..84382a6f 100644 --- a/AltServer/AppDelegate.swift +++ b/AltServer/AppDelegate.swift @@ -212,6 +212,10 @@ private extension AppDelegate { alert.informativeText = underlyingError.localizedDescription } + else if let recoverySuggestion = error.localizedRecoverySuggestion + { + alert.informativeText = error.localizedDescription + "\n\n" + recoverySuggestion + } else { alert.informativeText = error.localizedDescription