From 1e1ecdcbc1bbf8e2fb61c2d88e8008925774fcf2 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 4 Dec 2018 17:21:13 +0100 Subject: [PATCH] Reset folder error after successful --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6a5950501d..3489003ba4 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -893,11 +893,7 @@ public class ServiceSynchronize extends LifecycleService { try { ifolder.open(Folder.READ_WRITE); } catch (Throwable ex) { - if (ex instanceof MessagingException && "connection failure".equals(ex.getMessage())) { - Throwable ex1 = new MessagingException("Too many simultaneous connections?", (MessagingException) ex); - db.folder().setFolderError(folder.id, Helper.formatThrowable(ex1)); - } else - db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); + db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); throw ex; } folders.put(folder, ifolder); @@ -2020,6 +2016,8 @@ public class ServiceSynchronize extends LifecycleService { } } + db.folder().setFolderError(folder.id, null); + } finally { Log.v(Helper.TAG, folder.name + " end sync state=" + state); db.folder().setFolderSyncState(folder.id, null);