summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'walk.cc')
-rw-r--r--walk.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/walk.cc b/walk.cc
index 154014e8..6621a263 100644
--- a/walk.cc
+++ b/walk.cc
@@ -360,9 +360,14 @@ void walk_accounts(account_t& account,
const std::string& sort_string)
{
if (! sort_string.empty()) {
- std::auto_ptr<value_expr_t> sort_order(parse_value_expr(sort_string));
- if (! sort_order.get())
- throw error(std::string("Sort string failed to parse: " + sort_string));
+ std::auto_ptr<value_expr_t> sort_order;
+ try {
+ sort_order.reset(parse_value_expr(sort_string));
+ }
+ catch (value_expr_error& err) {
+ throw error(std::string("In sort string '" + sort_string + "': " +
+ err.what()));
+ }
walk_accounts(account, handler, sort_order.get());
} else {
walk_accounts(account, handler);