Handle message removed while getting attachments

This commit is contained in:
M66B 2018-09-06 12:23:54 +00:00
parent 03e5519715
commit e1447ad132
1 changed files with 16 additions and 0 deletions

View File

@ -521,6 +521,11 @@ public class ServiceSynchronize extends LifecycleService {
synchronizeMessage(ServiceSynchronize.this, folder, ifolder, (IMAPMessage) imessage, false);
} catch (MessageRemovedException ex) {
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
} catch (IOException ex) {
if (ex.getCause() instanceof MessageRemovedException)
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
else
throw ex;
}
EntityOperation.process(ServiceSynchronize.this); // download small attachments
} catch (Throwable ex) {
@ -583,6 +588,11 @@ public class ServiceSynchronize extends LifecycleService {
EntityOperation.process(ServiceSynchronize.this); // download small attachments
} catch (MessageRemovedException ex) {
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
} catch (IOException ex) {
if (ex.getCause() instanceof MessageRemovedException)
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
else
throw ex;
}
} catch (Throwable ex) {
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
@ -1282,6 +1292,12 @@ public class ServiceSynchronize extends LifecycleService {
unchanged++;
} catch (MessageRemovedException ex) {
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
} catch (IOException ex) {
// Getting attachments
if (ex.getCause() instanceof MessageRemovedException)
Log.w(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
else
throw ex;
}
EntityOperation.process(this); // download small attachments