aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-05-30 13:24:04 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-05-30 13:24:04 +0200
commitb8faa837429cbcb4f950248571c761c98895e7cd (patch)
treeeb4bec7dc42ef229b7fcab5a38c107ebc95874f5 /src/libstore
parentec07a70979a86cc436de7e46e03789b4606d25ab (diff)
HttpBinaryCacheStore::getFile(): Don't throw an exception
This violates the noexcept specification. Fixes #6445.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/http-binary-cache-store.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc
index 3cb5efdbf..73bcd6e81 100644
--- a/src/libstore/http-binary-cache-store.cc
+++ b/src/libstore/http-binary-cache-store.cc
@@ -161,7 +161,12 @@ protected:
void getFile(const std::string & path,
Callback<std::optional<std::string>> callback) noexcept override
{
- checkEnabled();
+ try {
+ checkEnabled();
+ } catch (...) {
+ callback.rethrow();
+ return;
+ }
auto request(makeRequest(path));