mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 23:02:27 +00:00
FSAccessor: Throw InvalidPath
This commit is contained in:
parent
f43823f676
commit
6cb4bdf152
@ -254,7 +254,7 @@ struct BinaryCacheStoreAccessor : public FSAccessor
|
||||
std::string restPath = std::string(path, storePath.size());
|
||||
|
||||
if (!store->isValidPath(storePath))
|
||||
throw Error(format("path ‘%1%’ is not a valid store path") % storePath);
|
||||
throw InvalidPath(format("path ‘%1%’ is not a valid store path") % storePath);
|
||||
|
||||
auto i = nars.find(storePath);
|
||||
if (i != nars.end()) return {i->second, restPath};
|
||||
|
@ -23,7 +23,7 @@ struct LocalStoreAccessor : public FSAccessor
|
||||
{
|
||||
Path storePath = store->toStorePath(path);
|
||||
if (!store->isValidPath(storePath))
|
||||
throw Error(format("path ‘%1%’ is not a valid store path") % storePath);
|
||||
throw InvalidPath(format("path ‘%1%’ is not a valid store path") % storePath);
|
||||
return store->getRealStoreDir() + std::string(path, store->storeDir.size());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user