mirror of
https://github.com/NixOS/nix.git
synced 2025-11-23 10:49:36 +01:00
This makes output of values that include errors much cleaner.
Before:
```
nix-repl> { err = builtins.throw "uh oh!"; }
{ err = «error:
… while calling the 'throw' builtin
at «string»:1:9:
1| { err = builtins.throw "uh oh!"; }
| ^
error: uh oh!»; }
```
After:
```
nix-repl> { err = builtins.throw "uh oh!"; }
{ err = «error: uh oh!»; }
```
But if the whole expression throws an error, source locations and (if
applicable) a stack trace are printed, like you'd expect:
```
nix-repl> builtins.throw "uh oh!"
error:
… while calling the 'throw' builtin
at «string»:1:1:
1| builtins.throw "uh oh!"
| ^
error: uh oh!
```
|
||
|---|---|---|
| .. | ||
| flake | ||
| value | ||
| derived-path.cc | ||
| error_traces.cc | ||
| eval.cc | ||
| json.cc | ||
| local.mk | ||
| primops.cc | ||
| search-path.cc | ||
| trivial.cc | ||