From 2f73668de59d1e9fb7f469acb2698e5ea8a9ca7b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 9 Jul 2020 17:06:29 +0200 Subject: [PATCH] Improved rule error messages --- app/src/main/java/eu/faircode/email/EntityRule.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 5a13d21159..5c1933f39f 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -335,7 +335,7 @@ public class EntityRule { case TYPE_AUTOMATION: return onActionAutomation(context, message, jaction); default: - throw new IllegalArgumentException("Unknown rule type=" + type); + throw new IllegalArgumentException("Unknown rule type=" + type + " name=" + name); } } @@ -375,7 +375,7 @@ public class EntityRule { DB db = DB.getInstance(context); EntityFolder folder = db.folder().getFolder(target); if (folder == null) - throw new IllegalArgumentException("Rule move to folder not found"); + throw new IllegalArgumentException("Rule move to folder not found name=" + name); List messages = db.message().getMessagesByThread( message.account, message.thread, thread ? null : message.id, message.folder); @@ -398,7 +398,7 @@ public class EntityRule { DB db = DB.getInstance(context); EntityFolder folder = db.folder().getFolder(target); if (folder == null) - throw new IllegalArgumentException("Rule copy to folder not found"); + throw new IllegalArgumentException("Rule copy to folder not found name=" + name); EntityOperation.queue(context, message, EntityOperation.COPY, target, false); @@ -414,11 +414,11 @@ public class EntityRule { EntityIdentity identity = db.identity().getIdentity(iid); if (identity == null) - throw new IllegalArgumentException("Rule identity not found"); + throw new IllegalArgumentException("Rule identity not found name=" + name); EntityAnswer answer = db.answer().getAnswer(aid); if (answer == null) - throw new IllegalArgumentException("Rule answer not found"); + throw new IllegalArgumentException("Rule answer not found name=" + name); Address[] from = new InternetAddress[]{new InternetAddress(identity.email, identity.name)};