1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02: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:
Jörg Thalheim 2024-05-25 23:06:56 +02:00
parent 5cfa75ea16
commit f97da4b11c
2 changed files with 3 additions and 1 deletions

View file

@ -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)