From 6cb4bdf1526bacb02fec015f89267e519b654b84 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 9 Aug 2016 11:46:27 +0200 Subject: FSAccessor: Throw InvalidPath --- src/libstore/binary-cache-store.cc | 2 +- src/libstore/local-fs-store.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc index 801ecd368a6b..e71ea6a57a34 100644 --- a/src/libstore/binary-cache-store.cc +++ b/src/libstore/binary-cache-store.cc @@ -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}; diff --git a/src/libstore/local-fs-store.cc b/src/libstore/local-fs-store.cc index 95c8ecd9ba22..4571a2211cd2 100644 --- a/src/libstore/local-fs-store.cc +++ b/src/libstore/local-fs-store.cc @@ -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()); } -- cgit 1.4.1