From 77c5df4053855addcf0ed58e0e45b0226bd0d31c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 Jun 2010 08:16:59 -0400 Subject: Errors involving value objects provide more context --- src/expr.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/expr.cc') 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; } -- cgit v1.2.3