diff options
| author | David Göransson <david.goransson@mullvad.net> | 2024-11-13 08:53:32 +0100 |
|---|---|---|
| committer | David Göransson <david.goransson@mullvad.net> | 2024-11-13 08:53:32 +0100 |
| commit | cc0515f03c8f69cb9f5ca86320d825e920c6ee81 (patch) | |
| tree | a74da99e763ed74e93c6d9946c0e4b594fbd6980 /android/lib/common/src | |
| parent | c83883562ca44b88c08fcf675c2058ea71c7f199 (diff) | |
| download | mullvadvpn-cc0515f03c8f69cb9f5ca86320d825e920c6ee81.tar.xz mullvadvpn-cc0515f03c8f69cb9f5ca86320d825e920c6ee81.zip | |
Clarify expired account message
Diffstat (limited to 'android/lib/common/src')
| -rw-r--r-- | android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ErrorStateExtension.kt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ErrorStateExtension.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ErrorStateExtension.kt index 5d30a01b2f..a61ec10c17 100644 --- a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ErrorStateExtension.kt +++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/ErrorStateExtension.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.lib.common.util import android.content.Context import net.mullvad.mullvadvpn.lib.common.R +import net.mullvad.mullvadvpn.lib.model.AuthFailedError import net.mullvad.mullvadvpn.lib.model.ErrorState import net.mullvad.mullvadvpn.lib.model.ErrorStateCause import net.mullvad.mullvadvpn.lib.model.ParameterGenerationError @@ -43,10 +44,10 @@ private fun resolveAlwaysOnVpnErrorNotificationMessage( } } -fun ErrorStateCause.errorMessageId(): Int { - return when (this) { +fun ErrorStateCause.errorMessageId(): Int = + when (this) { is ErrorStateCause.InvalidDnsServers -> R.string.invalid_dns_servers - is ErrorStateCause.AuthFailed -> R.string.auth_failed + is ErrorStateCause.AuthFailed -> error.errorMessageId() is ErrorStateCause.Ipv6Unavailable -> R.string.ipv6_unavailable is ErrorStateCause.FirewallPolicyError -> R.string.set_firewall_policy_error is ErrorStateCause.DnsError -> R.string.set_dns_error @@ -66,4 +67,11 @@ fun ErrorStateCause.errorMessageId(): Int { } is ErrorStateCause.VpnPermissionDenied -> R.string.vpn_permission_denied_error } -} + +fun AuthFailedError.errorMessageId(): Int = + when (this) { + AuthFailedError.ExpiredAccount -> R.string.account_credit_has_expired + AuthFailedError.InvalidAccount, + AuthFailedError.TooManyConnections, + AuthFailedError.Unknown -> R.string.auth_failed + } |
