From 89c782b0c0df6ca9d85207b62318e70729f18e24 Mon Sep 17 00:00:00 2001 From: julia Date: Sat, 18 May 2024 20:16:32 +1000 Subject: Change error messages about 'invalid paths' to 'path does not exist'. Fixes #270. Change-Id: I07d2da41498cfdf324a03af40533044d58c97c7e --- src/libstore/local-store.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index bae5fad7b..5bdf0362d 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -907,7 +907,7 @@ std::shared_ptr LocalStore::queryPathInfoInternal(State & s try { narHash = Hash::parseAnyPrefixed(useQueryPathInfo.getStr(1)); } catch (BadHash & e) { - throw Error("invalid-path entry for '%s': %s", printStorePath(path), e.what()); + throw BadStorePath("bad hash in store path '%s': %s", printStorePath(path), e.what()); } auto info = std::make_shared(path, narHash); @@ -957,8 +957,8 @@ void LocalStore::updatePathInfo(State & state, const ValidPathInfo & info) uint64_t LocalStore::queryValidPathId(State & state, const StorePath & path) { auto use(state.stmts->QueryPathInfo.use()(printStorePath(path))); - if (!use.next()) - throw InvalidPath("path '%s' is not valid", printStorePath(path)); + if (!use.next()) // TODO: I guess if SQLITE got corrupted..? + throw InvalidPath("path '%s' does not exist", printStorePath(path)); return use.getInt(0); } -- cgit v1.2.3