Browse Source

Continue sync after message exception

main
M66B 6 years ago
parent
commit
eb67542a4a
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 7
- 2
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -503,7 +503,7 @@ public class ServiceSynchronize extends LifecycleService {
}); });
// Fetch e-mail // Fetch e-mail
synchronizeMessages(folder, ifolder);
synchronizeMessages(account, folder, ifolder);
// Flags (like "seen") at the remote could be changed while synchronizing // Flags (like "seen") at the remote could be changed while synchronizing
@ -1108,7 +1108,7 @@ public class ServiceSynchronize extends LifecycleService {
} }
} }
private void synchronizeMessages(EntityFolder folder, IMAPFolder ifolder) throws MessagingException, IOException {
private void synchronizeMessages(EntityAccount account, EntityFolder folder, IMAPFolder ifolder) throws MessagingException, IOException {
try { try {
Log.v(Helper.TAG, folder.name + " start sync after=" + folder.after); Log.v(Helper.TAG, folder.name + " start sync after=" + folder.after);
@ -1152,6 +1152,11 @@ public class ServiceSynchronize extends LifecycleService {
uids.remove(ifolder.getUID(imessage)); uids.remove(ifolder.getUID(imessage));
} catch (MessageRemovedException ex) { } catch (MessageRemovedException ex) {
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex)); Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
} catch (Throwable ex) {
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
reportError(account.name, folder.name, ex);
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex));
} }
// Delete local messages not at remote // Delete local messages not at remote


Loading…
Cancel
Save