diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-09-03 13:00:55 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-09-03 13:45:35 +0200 |
commit | f186000367978fbe590343f47951232f42a30bec (patch) | |
tree | 4793e33f10f3d9b1daf6d7a99330b8452c7cbb6a /src/libstore/store-api.cc | |
parent | 7348653ff4fc4e9b2dc24943aabdb57179b1c75a (diff) |
Add some noexcepts
This is to assert that callback functions should never throw (since
the context in which they're called may not be able to handle the
exception).
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 88a5b2f44..5f63c53b5 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -329,13 +329,14 @@ ref<const ValidPathInfo> Store::queryPathInfo(const Path & storePath) void Store::queryPathInfo(const Path & storePath, - Callback<ref<ValidPathInfo>> callback) + Callback<ref<ValidPathInfo>> callback) noexcept { - assertStorePath(storePath); - - auto hashPart = storePathToHash(storePath); + std::string hashPart; try { + assertStorePath(storePath); + + hashPart = storePathToHash(storePath); { auto res = state.lock()->pathInfoCache.get(hashPart); |