Add error context while evaluating predicates

This commit is contained in:
John Wiegley 2009-02-26 05:02:49 -04:00
parent fbb734689b
commit 87ec7bc34a

View file

@ -84,7 +84,14 @@ public:
}
bool operator()(scope_t& item) {
return ! predicate || predicate.calc(item).strip_annotations(what_to_keep);
try {
return ! predicate || predicate.calc(item).strip_annotations(what_to_keep);
}
catch (const std::exception& err) {
add_error_context(_("While determining truth of predicate expression:"));
add_error_context(expr_context(predicate));
throw;
}
}
};