mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Merge pull request #5428 from kreisys/add-pos-to-json-type-error
toJSON: report error position for fancier output
This commit is contained in:
commit
164179983e
6 changed files with 20 additions and 18 deletions
|
@ -1011,7 +1011,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
|
|||
if (i->name == state.sStructuredAttrs) continue;
|
||||
|
||||
auto placeholder(jsonObject->placeholder(key));
|
||||
printValueAsJSON(state, true, *i->value, placeholder, context);
|
||||
printValueAsJSON(state, true, *i->value, pos, placeholder, context);
|
||||
|
||||
if (i->name == state.sBuilder)
|
||||
drv.builder = state.forceString(*i->value, context, posDrvName);
|
||||
|
@ -1690,7 +1690,7 @@ static void prim_toJSON(EvalState & state, const Pos & pos, Value * * args, Valu
|
|||
{
|
||||
std::ostringstream out;
|
||||
PathSet context;
|
||||
printValueAsJSON(state, true, *args[0], out, context);
|
||||
printValueAsJSON(state, true, *args[0], pos, out, context);
|
||||
mkString(v, out.str(), context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue