summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-11 03:05:33 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-11 03:05:33 -0500
commit2a41649584c731024c3d3331b8a4a5f4011b9693 (patch)
treed55f6559887ecc679b5add11540b1e35880b07fa /src/op.cc
parent6ddd935e4a140d77b9f94beeed1c76286c9cc1ca (diff)
downloadfork-ledger-2a41649584c731024c3d3331b8a4a5f4011b9693.tar.gz
fork-ledger-2a41649584c731024c3d3331b8a4a5f4011b9693.tar.bz2
fork-ledger-2a41649584c731024c3d3331b8a4a5f4011b9693.zip
Improve error reporting of nested function calls
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/op.cc b/src/op.cc
index 0773c093..23f47f73 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -537,13 +537,13 @@ value_t expr_t::op_t::calc_call(scope_t& scope, ptr_op_t * locus,
ptr_op_t func = left();
string name = func->is_ident() ? func->as_ident() : "<value expr>";
- try {
- func = find_definition(func, scope, locus, depth);
+ func = find_definition(func, scope, locus, depth);
- call_scope_t call_args(scope, locus, depth + 1);
- if (has_right())
- call_args.set_args(split_cons_expr(right()));
+ call_scope_t call_args(scope, locus, depth + 1);
+ if (has_right())
+ call_args.set_args(split_cons_expr(right()));
+ try {
if (func->is_function()) {
return func->as_function()(call_args);
} else {
@@ -552,7 +552,8 @@ value_t expr_t::op_t::calc_call(scope_t& scope, ptr_op_t * locus,
}
}
catch (const std::exception&) {
- add_error_context(_("While calling function '%1':" << name));
+ add_error_context(_("While calling function '%1 %2':" << name
+ << call_args.args));
throw;
}
}