From 74a7cd741e13e2fc4f0b5deead6025eaa9876ee1 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 22 Sep 2018 08:46:40 +0000 Subject: [PATCH] More friendly boundary error messages Fixes #138 --- .../java/eu/faircode/email/FragmentMessages.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 317b6cebe8..c90b56eb00 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -683,7 +683,11 @@ public class FragmentMessages extends FragmentEx { @Override public void onError(Context context, Throwable ex) { pbWait.setVisibility(View.GONE); - Helper.unexpectedError(context, ex); + new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) + .setMessage(Helper.formatThrowable(ex)) + .setPositiveButton(android.R.string.cancel, null) + .create() + .show(); } }); @@ -725,7 +729,11 @@ public class FragmentMessages extends FragmentEx { @Override public void onError(Context context, Throwable ex) { pbWait.setVisibility(View.GONE); - Helper.unexpectedError(context, ex); + new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) + .setMessage(Helper.formatThrowable(ex)) + .setPositiveButton(android.R.string.cancel, null) + .create() + .show(); } });