diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-07-23 12:52:40 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-07-23 15:13:24 +0300 |
| commit | 824d804a72c7b3658ce06b1dd8f5142a2dc77bb1 (patch) | |
| tree | cc13f4c4187f213005395bd6b116295d8397f03e | |
| parent | 75094b04d89ab8ad65d12b8fb912293ad6ccda54 (diff) | |
| download | mullvadvpn-824d804a72c7b3658ce06b1dd8f5142a2dc77bb1.tar.xz mullvadvpn-824d804a72c7b3658ce06b1dd8f5142a2dc77bb1.zip | |
Refactor IAP error messages
| -rw-r--r-- | ios/MullvadVPN/DisplayChainedError.swift | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ios/MullvadVPN/DisplayChainedError.swift b/ios/MullvadVPN/DisplayChainedError.swift index 4fa2883e6b..ec9eb5ff01 100644 --- a/ios/MullvadVPN/DisplayChainedError.swift +++ b/ios/MullvadVPN/DisplayChainedError.swift @@ -130,7 +130,14 @@ extension AppStorePaymentManager.Error: DisplayChainedError { return NSLocalizedString("Internal error: account is not set", comment: "") case .readReceipt(let readReceiptError): - return String(format: NSLocalizedString("Cannot read the receipt: %@", comment: ""), readReceiptError.errorChainDescription ?? "") + switch readReceiptError { + case .refresh(let storeError): + return String(format: NSLocalizedString("Cannot refresh the AppStore receipt: %@", comment: ""), storeError.localizedDescription) + case .io(let ioError): + return String(format: NSLocalizedString("Cannot read the AppStore receipt from disk: %@", comment: ""), ioError.localizedDescription) + case .doesNotExist: + return NSLocalizedString("AppStore receipt is not found on disk.", comment: "") + } case .sendReceipt(let restError): let reason = restError.errorChainDescription ?? "" |
