aboutsummaryrefslogtreecommitdiffstats
path: root/test/testdata/eval-fail-addErrorContext-example.nix
blob: 996b24688492438a4a14f4514eabed40e6f5659b (about) (plain) (blame)
1
2
3
4
5
6
7
8
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