update(engine): temporary replace for error messages

Signed-off-by: Luca Guerra <luca@guerra.sh>
This commit is contained in:
Luca Guerra 2023-12-22 16:16:54 +00:00 committed by poiana
parent 8a7ef687b1
commit 4c023b0d93
2 changed files with 10 additions and 6 deletions

View File

@ -191,7 +191,8 @@ void rule_loader::collector::append(configuration& cfg, list_info& info)
{ {
auto prev = m_list_infos.at(info.name); auto prev = m_list_infos.at(info.name);
THROW(!prev, THROW(!prev,
"List has 'append' key or an append override but no list by that name already exists", // "List has 'append' key or an append override but no list by that name already exists", // TODO update this error and update testing
"List has 'append' key but no list by that name already exists",
info.ctx); info.ctx);
prev->items.insert(prev->items.end(), info.items.begin(), info.items.end()); prev->items.insert(prev->items.end(), info.items.begin(), info.items.end());
append_info(prev, info, m_cur_index++); append_info(prev, info, m_cur_index++);
@ -244,10 +245,12 @@ void rule_loader::collector::append(configuration& cfg, rule_update_info& info)
auto prev = m_rule_infos.at(info.name); auto prev = m_rule_infos.at(info.name);
THROW(!prev, THROW(!prev,
"Rule has 'append' key or an append override but no rule by that name already exists", // "Rule has 'append' key or an append override but no rule by that name already exists", // TODO replace with this and update testing
"Rule has 'append' key but no rule by that name already exists",
info.ctx); info.ctx);
THROW(!info.has_any_value(), THROW(!info.has_any_value(),
"Appended rule must have at least one field that can be appended to", "Appended rule must have exceptions or condition property",
// "Appended rule must have at least one field that can be appended to", // TODO replace with this and update testing
info.ctx); info.ctx);
// note: source can be nullptr in case we've collected a // note: source can be nullptr in case we've collected a

View File

@ -663,9 +663,10 @@ static void read_item(
read_rule_exceptions(item, v.exceptions, ctx, true); read_rule_exceptions(item, v.exceptions, ctx, true);
} }
THROW((!v.cond.has_value() && !v.exceptions.has_value()), // TODO restore this error and update testing
"Appended rule must have exceptions or condition property", //THROW((!v.cond.has_value() && !v.exceptions.has_value()),
v.ctx); // "Appended rule must have exceptions or condition property",
// v.ctx);
collector.append(cfg, v); collector.append(cfg, v);
} }