From feb329172893a649c57da98999a90086747d6574 Mon Sep 17 00:00:00 2001 From: Artem Hryhorov Date: Tue, 17 Aug 2021 16:48:44 +0300 Subject: [PATCH 1/2] Added error handling after appling referral token --- .../vpn/ui/prepare/top/up/PrepareTopUpActivity.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt b/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt index 069c5fe9c..172fded58 100644 --- a/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt +++ b/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt @@ -5,6 +5,7 @@ import android.os.Bundle import android.util.Log import android.view.View import android.widget.EditText +import android.widget.Toast import androidx.core.content.ContextCompat import androidx.core.widget.addTextChangedListener import network.mysterium.vpn.R @@ -157,6 +158,14 @@ class PrepareTopUpActivity : BaseActivity() { isReferralTokenUsed = true onSuccess.invoke() } + it.onFailure { throwable -> + Log.i(TAG, throwable.localizedMessage ?: throwable.toString()) + Toast.makeText( + this, + getString(R.string.intercom_something_went_wrong_try_again), + Toast.LENGTH_LONG + ).show() + } }) } From da66cb6a1455aeadaef4bfc561f5aa45b86e5e4f Mon Sep 17 00:00:00 2001 From: Artem Hryhorov Date: Tue, 17 Aug 2021 16:50:29 +0300 Subject: [PATCH 2/2] Change Log type to error --- .../mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt b/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt index 172fded58..1eb4b442a 100644 --- a/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt +++ b/android/app/src/main/java/updated/mysterium/vpn/ui/prepare/top/up/PrepareTopUpActivity.kt @@ -159,7 +159,7 @@ class PrepareTopUpActivity : BaseActivity() { onSuccess.invoke() } it.onFailure { throwable -> - Log.i(TAG, throwable.localizedMessage ?: throwable.toString()) + Log.e(TAG, throwable.localizedMessage ?: throwable.toString()) Toast.makeText( this, getString(R.string.intercom_something_went_wrong_try_again),