Delete not found folders

This commit is contained in:
M66B 2019-05-25 16:45:46 +02:00
parent c671c1b9d9
commit 583b584935
1 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,7 @@ import java.util.concurrent.RejectedExecutionException;
import javax.mail.FetchProfile;
import javax.mail.Folder;
import javax.mail.FolderClosedException;
import javax.mail.FolderNotFoundException;
import javax.mail.Message;
import javax.mail.MessageRemovedException;
import javax.mail.MessagingException;
@ -728,6 +729,10 @@ public class ServiceSynchronize extends LifecycleService {
db.folder().setFolderError(folder.id, Helper.formatThrowable(ex1, true));
continue;
}
} catch (FolderNotFoundException ex) {
Log.w(ex);
db.folder().deleteFolder(folder.id);
continue;
} catch (MessagingException ex) {
Log.w(ex);
db.folder().setFolderState(folder.id, null);