From ca687ed523b22aae05d791f8ccf8023f088a1d9e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Jun 2020 17:21:42 +0200 Subject: [PATCH] Improved error handling --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 4 ++-- 1 file changed, 2 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 a71b4c832d..2394a148c5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5243,7 +5243,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. DB db = DB.getInstance(context); EntityMessage message = db.message().getMessage(id); if (message == null) - throw new FileNotFoundException(); + throw new FileNotFoundException("message gone"); File file = message.getRawFile(context); Log.i("Raw file=" + file); @@ -5292,7 +5292,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override protected void onException(Bundle args, Throwable ex) { - if (ex instanceof IllegalArgumentException) + if (ex instanceof IllegalArgumentException || ex instanceof FileNotFoundException) Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show(); else Log.unexpectedError(getParentFragmentManager(), ex);