From d8f95f46bb543e36653df5fd6c173d6f6d60bcbd Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 19 Feb 2021 13:17:33 +0100 Subject: [PATCH] Added error messages --- app/src/main/java/eu/faircode/email/Core.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 739e592a8b..80402073de 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -950,8 +950,11 @@ class Core { // Check message ID to check raw message file content MessageHelper helper = new MessageHelper(imessage, context); String msgid = helper.getMessageID(); - if (TextUtils.isEmpty(message.msgid) || !Objects.equals(message.msgid, msgid)) - throw new IllegalArgumentException("Inconsistent msgid=" + message.msgid + "/" + msgid); + if (TextUtils.isEmpty(message.msgid) || !Objects.equals(message.msgid, msgid)) { + String msg = "Inconsistent msgid=" + message.msgid + "/" + msgid; + Log.e(msg); + throw new IllegalArgumentException(msg); + } } db.message().setMessageRaw(message.id, true); @@ -1022,8 +1025,11 @@ class Core { } } else { Long found = findUid(context, ifolder, message.msgid, false); - if (found == null) - throw new IllegalArgumentException("Added message not found"); + if (found == null) { + String msg = "Added message not found msgid" + message.msgid; + Log.e(msg); + throw new IllegalArgumentException(msg); + } // Mark source read if (autoread)