From bd3a963f96f0c9041c652f038a364e67f6d5d035 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 13 Dec 2022 22:23:09 +0100 Subject: [PATCH] Improved error message --- app/src/main/java/eu/faircode/email/Log.java | 3 +++ .../eu/faircode/email/ServiceSynchronize.java | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index d96647a8ba..5c4917c9d8 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -1741,6 +1741,9 @@ public class Log { ex.getCause() instanceof SocketTimeoutException) ex = new Throwable("No response received from email server", ex); + if (ex.getMessage() != null && ex.getMessage().contains("Read timed out")) + ex = new Throwable("No response received from email server", ex); + if (ex instanceof MessagingException && ex.getCause() instanceof UnknownHostException) ex = new Throwable("Email server address lookup failed", ex); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index cc2f088459..1eabaf468b 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1970,6 +1970,21 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences state.activity(); } } catch (Throwable ex) { + /* + javax.mail.FolderClosedException: * BYE Jakarta Mail Exception: java.net.SocketTimeoutException: Read timed out + at com.sun.mail.imap.IMAPFolder.handleIdle(SourceFile:252) + at com.sun.mail.imap.IMAPFolder.idle(SourceFile:7) + at eu.faircode.email.ServiceSynchronize$21.delegate(SourceFile:78) + at eu.faircode.email.RunnableEx.run(SourceFile:1) + at java.lang.Thread.run(Thread.java:1012) + ... javax.mail.StoreClosedException: NOOP INBOX + javax.mail.StoreClosedException: NOOP INBOX + at eu.faircode.email.ServiceSynchronize.monitorAccount(SourceFile:151) + at eu.faircode.email.ServiceSynchronize.access$1200(Unknown Source:0) + at eu.faircode.email.ServiceSynchronize$4$2.delegate(SourceFile:15) + at eu.faircode.email.RunnableEx.run(SourceFile:1) + at java.lang.Thread.run(Thread.java:1012) + */ Log.e(folder.name, ex); EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Account, folder, account.name + "/" + folder.name + " idle " + Log.formatThrowable(ex, false));