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:
parent
1a93ac8133
commit
b8b8ec7101
8 changed files with 361 additions and 140 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue