diff options
| -rw-r--r-- | ios/CHANGELOG.md | 5 | ||||
| -rw-r--r-- | ios/MullvadVPN/Account.swift | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/ios/CHANGELOG.md b/ios/CHANGELOG.md index 22b03a8aab..f78a20ff4f 100644 --- a/ios/CHANGELOG.md +++ b/ios/CHANGELOG.md @@ -23,7 +23,8 @@ Line wrap the file at 100 chars. Th ## [Unreleased] - +### Fixed +- Fix "invalid account" error that was mistakenly reported as "network error" during log in. ## [2020.1] - 2020-04-08 Initial release. Supports... @@ -32,4 +33,4 @@ Initial release. Supports... * See account expiry * Purchase more VPN time via in-app purchases * See the current WireGuard key in use and how long it has been used -* Generate a new WireGuard key to replace the old
\ No newline at end of file +* Generate a new WireGuard key to replace the old diff --git a/ios/MullvadVPN/Account.swift b/ios/MullvadVPN/Account.swift index 942b8c5a39..6677005615 100644 --- a/ios/MullvadVPN/Account.swift +++ b/ios/MullvadVPN/Account.swift @@ -26,7 +26,6 @@ enum AccountError: Error { /// A enum describing the error emitted during login enum AccountLoginError: Error { - case invalidAccount case network(MullvadAPI.Error) case communication(MullvadAPI.ResponseError) case tunnelConfiguration(TunnelManagerError) @@ -57,12 +56,15 @@ extension AccountError: LocalizedError { case .createNew(.network), .createNew(.communication): return NSLocalizedString("Failed to create new account", comment: "") - case .login(.invalidAccount): + case .login(.communication(let serverError)) where serverError.code == .accountDoesNotExist: return NSLocalizedString("Invalid account", comment: "") - case .login(.network), .login(.communication): + case .login(.network): return NSLocalizedString("Network error", comment: "") + case .login(.communication): + return NSLocalizedString("Server error", comment: "") + case .login(.tunnelConfiguration(.setAccount(let setAccountError))), .createNew(.tunnelConfiguration(.setAccount(let setAccountError))): switch setAccountError { |
