diff options
author | Qyriad <qyriad@qyriad.me> | 2024-06-22 21:22:29 -0600 |
---|---|---|
committer | Qyriad <qyriad@qyriad.me> | 2024-07-04 16:33:02 -0600 |
commit | d00edfb28d0a52d9acd392c582a43f98e773cf4c (patch) | |
tree | 7e63c09fe2d333341d390793d2ddd021e040e36a /tests/functional | |
parent | 139cfdfb5309407694b92f5f710400a5bc03f313 (diff) |
trace when the `foo` part of `foo.bar.baz` errors
Turns errors like:
let
errpkg = throw "invalid foobar";
in errpkg.meta
error:
… while calling the 'throw' builtin
at «string»:2:12:
1| let
2| errpkg = throw "invalid foobar";
| ^
3| in errpkg.meta
error: invalid foobar
into errors like:
let
errpkg = throw "invalid foobar";
in errpkg.meta
error:
… while evaluating 'errpkg' to select 'meta' on it
at «string»:3:4:
2| errpkg = throw "invalid foobar";
3| in errpkg.meta
| ^
… while calling the 'throw' builtin
at «string»:2:12:
1| let
2| errpkg = throw "invalid foobar";
| ^
3| in errpkg.meta
error: invalid foobar
For the low price of one try/catch, you too can have the incorrect line
of code actually show up in the trace!
Change-Id: If8d6200ec1567706669d405c34adcd7e2d2cd29d
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/lang/eval-fail-recursion.err.exp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/functional/lang/eval-fail-recursion.err.exp b/tests/functional/lang/eval-fail-recursion.err.exp index 19380dc65..f0057b2d5 100644 --- a/tests/functional/lang/eval-fail-recursion.err.exp +++ b/tests/functional/lang/eval-fail-recursion.err.exp @@ -1,4 +1,10 @@ error: + … while evaluating 'a' to select 'foo' on it + at /pwd/lang/eval-fail-recursion.nix:1:21: + 1| let a = {} // a; in a.foo + | ^ + 2| + … in the right operand of the update (//) operator at /pwd/lang/eval-fail-recursion.nix:1:12: 1| let a = {} // a; in a.foo |