From 87ec7bc34a78ae67101514d6507b90fe691e0010 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 26 Feb 2009 05:02:49 -0400 Subject: Add error context while evaluating predicates --- src/predicate.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/predicate.h b/src/predicate.h index e4cc73a3..c3773c43 100644 --- a/src/predicate.h +++ b/src/predicate.h @@ -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; + } } }; -- cgit v1.2.3