mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Improved error handling
This commit is contained in:
parent
f96860ead5
commit
da8c490640
1 changed files with 4 additions and 2 deletions
|
@ -409,6 +409,7 @@ class Core {
|
|||
ex instanceof FileNotFoundException ||
|
||||
ex instanceof FolderNotFoundException ||
|
||||
ex instanceof IllegalArgumentException ||
|
||||
ex instanceof SQLiteConstraintException ||
|
||||
ex.getCause() instanceof BadCommandException ||
|
||||
ex.getCause() instanceof CommandFailedException) {
|
||||
// com.sun.mail.iap.BadCommandException: B13 BAD [TOOBIG] Message too large
|
||||
|
@ -489,12 +490,13 @@ class Core {
|
|||
if (TextUtils.isEmpty(message.msgid))
|
||||
throw new IllegalArgumentException("Message without msgid for " + op.name);
|
||||
|
||||
message.uid = findUid(ifolder, message.msgid, false);
|
||||
if (message.uid == null)
|
||||
Long uid = findUid(ifolder, message.msgid, false);
|
||||
if (uid == null)
|
||||
throw new IllegalArgumentException("Message not found for " + op.name);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.message().setMessageUid(message.id, message.uid);
|
||||
message.uid = uid;
|
||||
}
|
||||
|
||||
private static Long findUid(IMAPFolder ifolder, String msgid, boolean purge) throws MessagingException {
|
||||
|
|
Loading…
Reference in a new issue