diff options
author | Ben Burdette <bburdette@protonmail.com> | 2022-03-14 11:39:53 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@protonmail.com> | 2022-03-14 11:39:53 -0600 |
commit | eaecaaa00ba79b05f49a908f2c96c6507d3a2d7b (patch) | |
tree | a42d64cd65a84d76ee7cc15e168e176a263c3165 /src/libexpr/value-to-json.cc | |
parent | 3d94d3ba91d8cde069ca635aae4c070c85a99759 (diff) |
more debug_throw coverage of EvalErrors
Diffstat (limited to 'src/libexpr/value-to-json.cc')
-rw-r--r-- | src/libexpr/value-to-json.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libexpr/value-to-json.cc b/src/libexpr/value-to-json.cc index 517da4c01..d8bf73cd5 100644 --- a/src/libexpr/value-to-json.cc +++ b/src/libexpr/value-to-json.cc @@ -84,7 +84,8 @@ void printValueAsJSON(EvalState & state, bool strict, .msg = hintfmt("cannot convert %1% to JSON", showType(v)), .errPos = v.determinePos(pos) }); - throw e.addTrace(pos, hintfmt("message for the trace")); + e.addTrace(pos, hintfmt("message for the trace")); + state.debug_throw(e); } } @@ -98,7 +99,7 @@ void printValueAsJSON(EvalState & state, bool strict, void ExternalValueBase::printValueAsJSON(EvalState & state, bool strict, JSONPlaceholder & out, PathSet & context) const { - throw TypeError("cannot convert %1% to JSON", showType()); + state.debug_throw(TypeError("cannot convert %1% to JSON", showType())); } |