1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-23 06:31:17 +00:00

Improved error handling

This commit is contained in:
M66B 2019-11-10 11:25:13 +01:00
parent f96860ead5
commit da8c490640

View file

@ -409,6 +409,7 @@ class Core {
ex instanceof FileNotFoundException || ex instanceof FileNotFoundException ||
ex instanceof FolderNotFoundException || ex instanceof FolderNotFoundException ||
ex instanceof IllegalArgumentException || ex instanceof IllegalArgumentException ||
ex instanceof SQLiteConstraintException ||
ex.getCause() instanceof BadCommandException || ex.getCause() instanceof BadCommandException ||
ex.getCause() instanceof CommandFailedException) { ex.getCause() instanceof CommandFailedException) {
// com.sun.mail.iap.BadCommandException: B13 BAD [TOOBIG] Message too large // com.sun.mail.iap.BadCommandException: B13 BAD [TOOBIG] Message too large
@ -489,12 +490,13 @@ class Core {
if (TextUtils.isEmpty(message.msgid)) if (TextUtils.isEmpty(message.msgid))
throw new IllegalArgumentException("Message without msgid for " + op.name); throw new IllegalArgumentException("Message without msgid for " + op.name);
message.uid = findUid(ifolder, message.msgid, false); Long uid = findUid(ifolder, message.msgid, false);
if (message.uid == null) if (uid == null)
throw new IllegalArgumentException("Message not found for " + op.name); throw new IllegalArgumentException("Message not found for " + op.name);
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
db.message().setMessageUid(message.id, message.uid); db.message().setMessageUid(message.id, message.uid);
message.uid = uid;
} }
private static Long findUid(IMAPFolder ifolder, String msgid, boolean purge) throws MessagingException { private static Long findUid(IMAPFolder ifolder, String msgid, boolean purge) throws MessagingException {