1
0
Fork 0
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:
Théophane Hufschmitt 2024-03-29 09:10:09 +01:00 committed by GitHub
commit de101417eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 96 additions and 20 deletions

View file

@ -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

View file

@ -0,0 +1 @@
--eval --strict --no-show-trace

View file

@ -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