aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-04-08 12:34:27 -0600
committerBen Burdette <bburdette@protonmail.com>2022-04-08 12:34:27 -0600
commitb8b8ec710160cfd343a8fce33ec8734e23c98444 (patch)
tree0595e07240c1497e00b7e6c41c3852cf4524bfd4 /src/libexpr/parser.y
parent1a93ac8133381eb692416c4e46b1706faa5cd89f (diff)
move throw to preverve Error type; turn off debugger for tryEval
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 4182f36d5..ecfa5b7c2 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -783,14 +783,15 @@ Path EvalState::findFile(SearchPath & searchPath, const std::string_view path, c
if (hasPrefix(path, "nix/"))
return concatStrings(corepkgsPrefix, path.substr(4));
- debug_throw(ThrownError({
+ auto e = ThrownError({
.msg = hintfmt(evalSettings.pureEval
? "cannot look up '<%s>' in pure evaluation mode (use '--impure' to override)"
: "file '%s' was not found in the Nix search path (add it using $NIX_PATH or -I)",
path),
.errPos = pos
- }));
- return Path(); // should never execute due to debug_throw above.
+ });
+ debugLastTrace(e);
+ throw e;
}