From d7b7a4ce7cbeffac71de77d67358a61acd85d232 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 14 Sep 2018 14:13:14 +0000 Subject: [PATCH] Suppress folder closed messages --- app/src/main/java/eu/faircode/email/Helper.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 6e88135c..23ba0ddd 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -49,6 +49,7 @@ import java.security.NoSuchAlgorithmException; import java.util.concurrent.ThreadFactory; import javax.mail.Address; +import javax.mail.FolderClosedException; import javax.mail.internet.InternetAddress; import static android.os.Process.THREAD_PRIORITY_BACKGROUND; @@ -106,6 +107,11 @@ public class Helper { } static String formatThrowable(Throwable ex) { + if (ex instanceof FolderClosedException) + return null; + if (ex instanceof IllegalStateException) + return null; + StringBuilder sb = new StringBuilder(); sb.append(ex.getMessage() == null ? ex.getClass().getName() : ex.getMessage()); Throwable cause = ex.getCause();