summaryrefslogtreecommitdiff
path: root/src/predicate.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-26 05:02:49 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-26 05:02:49 -0400
commit87ec7bc34a78ae67101514d6507b90fe691e0010 (patch)
tree34a5c55392ba4a25ba4cbb71c16945f3d4e90d22 /src/predicate.h
parentfbb734689b8989bb8bc5df8217b1469e084ca64b (diff)
downloadfork-ledger-87ec7bc34a78ae67101514d6507b90fe691e0010.tar.gz
fork-ledger-87ec7bc34a78ae67101514d6507b90fe691e0010.tar.bz2
fork-ledger-87ec7bc34a78ae67101514d6507b90fe691e0010.zip
Add error context while evaluating predicates
Diffstat (limited to 'src/predicate.h')
-rw-r--r--src/predicate.h9
1 files changed, 8 insertions, 1 deletions
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;
+ }
}
};