mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
Merge pull request #10305 from hercules-ci/addErrorContext-is-great
Always print addErrorContext
This commit is contained in:
commit
de101417eb
9 changed files with 96 additions and 20 deletions
|
@ -0,0 +1,24 @@
|
|||
error:
|
||||
… while counting down; n = 10
|
||||
|
||||
… while counting down; n = 9
|
||||
|
||||
… while counting down; n = 8
|
||||
|
||||
… while counting down; n = 7
|
||||
|
||||
… while counting down; n = 6
|
||||
|
||||
… while counting down; n = 5
|
||||
|
||||
… while counting down; n = 4
|
||||
|
||||
… while counting down; n = 3
|
||||
|
||||
… while counting down; n = 2
|
||||
|
||||
… while counting down; n = 1
|
||||
|
||||
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
|
||||
|
||||
error: kaboom
|
|
@ -0,0 +1 @@
|
|||
--eval --strict --no-show-trace
|
|
@ -0,0 +1,9 @@
|
|||
let
|
||||
countDown = n:
|
||||
if n == 0
|
||||
then throw "kaboom"
|
||||
else
|
||||
builtins.addErrorContext
|
||||
"while counting down; n = ${toString n}"
|
||||
("x" + countDown (n - 1));
|
||||
in countDown 10
|
Loading…
Add table
Add a link
Reference in a new issue