more debug_throw coverage of EvalErrors

This commit is contained in:
Ben Burdette
2022-03-14 11:39:53 -06:00
parent 3d94d3ba91
commit eaecaaa00b
5 changed files with 35 additions and 30 deletions
+3 -2
View File
@@ -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()));
}