mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
move throw to preverve Error type; turn off debugger for tryEval
This commit is contained in:
parent
1a93ac8133
commit
b8b8ec7101
8 changed files with 361 additions and 140 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue