From 1cc3d79ce9d0346be5957a8d60882a38e300aa09 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 15 Sep 2018 05:49:54 +0000 Subject: [PATCH] Unexpected error handling --- .../main/java/eu/faircode/email/ActivityBilling.java | 3 +-- app/src/main/java/eu/faircode/email/ActivityView.java | 8 ++++---- app/src/main/java/eu/faircode/email/AdapterFolder.java | 3 +-- .../main/java/eu/faircode/email/AdapterMessage.java | 3 +-- app/src/main/java/eu/faircode/email/FragmentAbout.java | 3 +-- .../main/java/eu/faircode/email/FragmentAccount.java | 9 ++++----- .../main/java/eu/faircode/email/FragmentAnswer.java | 5 ++--- .../main/java/eu/faircode/email/FragmentCompose.java | 8 ++++---- .../main/java/eu/faircode/email/FragmentFolder.java | 5 ++--- .../main/java/eu/faircode/email/FragmentIdentity.java | 5 ++--- .../main/java/eu/faircode/email/FragmentMessage.java | 10 +++++----- .../main/java/eu/faircode/email/FragmentMessages.java | 7 +++---- app/src/main/java/eu/faircode/email/FragmentSetup.java | 7 +++---- app/src/main/java/eu/faircode/email/Helper.java | 10 ++++++++++ app/src/main/res/values/strings.xml | 1 + 15 files changed, 44 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityBilling.java b/app/src/main/java/eu/faircode/email/ActivityBilling.java index 4fd5b7a1..36a3ebd3 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBilling.java +++ b/app/src/main/java/eu/faircode/email/ActivityBilling.java @@ -12,7 +12,6 @@ import android.preference.PreferenceManager; import android.provider.Settings; import android.util.Log; import android.view.View; -import android.widget.Toast; import com.android.billingclient.api.BillingClient; import com.android.billingclient.api.BillingClientStateListener; @@ -144,7 +143,7 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL setIntent(intent); } catch (NoSuchAlgorithmException ex) { Log.e(Helper.TAG, Log.getStackTraceString(ex)); - Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show(); + Helper.unexpectedError(this, ex); } } diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 877c0a7c..0191098c 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -466,7 +466,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB @Override protected void onException(Bundle args, Throwable ex) { - Toast.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show(); + Helper.unexpectedError(ActivityView.this, ex); } }.load(this, args); } @@ -553,7 +553,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB @Override protected void onException(Bundle args, Throwable ex) { if (BuildConfig.DEBUG) - Toast.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show(); + Helper.unexpectedError(ActivityView.this, ex); } }.load(this, new Bundle()); } @@ -783,7 +783,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB @Override protected void onException(Bundle args, Throwable ex) { - Toast.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show(); + Helper.unexpectedError(ActivityView.this, ex); } }.load(ActivityView.this, intent.getExtras()); } @@ -874,7 +874,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB @Override protected void onException(Bundle args, Throwable ex) { Log.e(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex)); - Toast.makeText(ActivityView.this, ex.toString(), Toast.LENGTH_LONG).show(); + Helper.unexpectedError(ActivityView.this, ex); } }.load(this, args); } diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 9a9d7a85..4f27bacc 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -31,7 +31,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; -import android.widget.Toast; import java.text.Collator; import java.util.ArrayList; @@ -204,7 +203,7 @@ public class AdapterFolder extends RecyclerView.AdapterInvalid response FairEmail needs your help. Tap to purchase pro features to keep the project going. + Unexpected error Log Debug info Please describe the problem and indicate the time of the problem: