Added rule name to exceptions

master
M66B 1 week ago
parent 853fe4c707
commit e552a16e28

@ -3272,7 +3272,7 @@ class Core {
} while (count > 0);
}
private static void onRule(Context context, JSONArray jargs, EntityMessage message) throws JSONException, MessagingException, IOException {
private static void onRule(Context context, JSONArray jargs, EntityMessage message) throws Throwable {
// Deferred rule (download headers, body, etc)
DB db = DB.getInstance(context);

@ -218,11 +218,12 @@ public class EntityRule {
static int run(Context context, List<EntityRule> rules,
EntityMessage message, boolean browsed, List<Header> headers, String html)
throws JSONException, MessagingException, IOException {
throws Throwable {
int applied = 0;
List<String> stopped = new ArrayList<>();
for (EntityRule rule : rules) {
for (EntityRule rule : rules)
try {
if (rule.group != null && stopped.contains(rule.group))
continue;
if (rule.matches(context, message, headers, html)) {
@ -236,6 +237,8 @@ public class EntityRule {
stopped.add(rule.group);
}
}
} catch (Throwable ex) {
throw new Throwable(rule.name, ex);
}
return applied;

@ -1201,7 +1201,7 @@ public class FragmentFolders extends FragmentBase {
}
@Override
protected Integer onExecute(Context context, Bundle args) throws JSONException, MessagingException, IOException {
protected Integer onExecute(Context context, Bundle args) throws Throwable {
long fid = args.getLong("id");
DB db = DB.getInstance(context);

@ -249,7 +249,7 @@ public class ServiceExternal extends ServiceBase {
ServiceSynchronize.eval(context, "external account=" + accountName + " enabled=" + enabled);
}
private static void rule(Context context, Intent intent) throws IOException, JSONException, MessagingException {
private static void rule(Context context, Intent intent) throws Throwable {
String accountName = intent.getStringExtra("account");
String ruleName = intent.getStringExtra("rule");

Loading…
Cancel
Save