diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-10 08:16:59 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-10 08:16:59 -0400 |
commit | 77c5df4053855addcf0ed58e0e45b0226bd0d31c (patch) | |
tree | de5641a591a3669ebbe686151b9c40b2910b8e38 /src/expr.cc | |
parent | 7be17fd779db1ee2a20064bdf3b4a8f5da3eb968 (diff) | |
download | fork-ledger-77c5df4053855addcf0ed58e0e45b0226bd0d31c.tar.gz fork-ledger-77c5df4053855addcf0ed58e0e45b0226bd0d31c.tar.bz2 fork-ledger-77c5df4053855addcf0ed58e0e45b0226bd0d31c.zip |
Errors involving value objects provide more context
Diffstat (limited to 'src/expr.cc')
-rw-r--r-- | src/expr.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/expr.cc b/src/expr.cc index f3a30de6..62058e0b 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -78,6 +78,8 @@ value_t expr_t::real_calc(scope_t& scope) } catch (const std::exception& err) { if (locus) { + string current_context = error_context(); + add_error_context(_("While evaluating value expression:")); add_error_context(op_context(ptr, locus)); @@ -103,6 +105,9 @@ value_t expr_t::real_calc(scope_t& scope) } add_error_context(out.str()); } + + if (! current_context.empty()) + add_error_context(current_context); } throw; } |