1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

move throw to preverve Error type; turn off debugger for tryEval

This commit is contained in:
Ben Burdette 2022-04-08 12:34:27 -06:00
parent 1a93ac8133
commit b8b8ec7101
8 changed files with 361 additions and 140 deletions

View file

@ -85,7 +85,8 @@ void printValueAsJSON(EvalState & state, bool strict,
.errPos = v.determinePos(pos)
});
e.addTrace(pos, hintfmt("message for the trace"));
state.debug_throw(e);
state.debugLastTrace(e);
throw e;
}
}
@ -99,7 +100,9 @@ void printValueAsJSON(EvalState & state, bool strict,
void ExternalValueBase::printValueAsJSON(EvalState & state, bool strict,
JSONPlaceholder & out, PathSet & context) const
{
state.debug_throw(TypeError("cannot convert %1% to JSON", showType()));
auto e = TypeError("cannot convert %1% to JSON", showType());
state.debugLastTrace(e);
throw e;
}