mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
libutil/source-accessor: custom error if source does not exist
This allows better error handling by catching this error in particular.
This commit is contained in:
parent
5cfa75ea16
commit
f97da4b11c
@ -53,7 +53,7 @@ SourceAccessor::Stat SourceAccessor::lstat(const CanonPath & path)
|
||||
if (auto st = maybeLstat(path))
|
||||
return *st;
|
||||
else
|
||||
throw Error("path '%s' does not exist", showPath(path));
|
||||
throw FileNotFound("path '%s' does not exist", showPath(path));
|
||||
}
|
||||
|
||||
void SourceAccessor::setPathDisplay(std::string displayPrefix, std::string displaySuffix)
|
||||
|
@ -29,6 +29,8 @@ enum class SymlinkResolution {
|
||||
Full,
|
||||
};
|
||||
|
||||
MakeError(FileNotFound, Error);
|
||||
|
||||
/**
|
||||
* A read-only filesystem abstraction. This is used by the Nix
|
||||
* evaluator and elsewhere for accessing sources in various
|
||||
|
Loading…
Reference in New Issue
Block a user