summaryrefslogtreecommitdiff
path: root/src/format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.cc')
-rw-r--r--src/format.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/format.cc b/src/format.cc
index 79ec2c0c..eeaf6fe4 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -298,7 +298,8 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
value.strip_annotations().dump(out, elem->min_width);
}
catch (const calc_error&) {
- out << (string("%") + elem->chars);
+ add_error_context("While calculating format expression:");
+ add_error_context(expr_context(elem->expr));
throw;
}
break;