aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/http-binary-cache-store.cc
diff options
context:
space:
mode:
authorNikola Knezevic <nikola@knezevic.ch>2020-04-06 23:00:43 +0200
committerNikola Knezevic <nikola@knezevic.ch>2020-04-08 22:26:57 +0200
commitc4c1ae0a00e8dd3258af58c15b664828b592133e (patch)
tree27c878eadb1582e8f911a76a0a5b83a78109d890 /src/libstore/http-binary-cache-store.cc
parent213d124277460b316cfa03d43e4ec279bba86219 (diff)
DownloadError -> DataTransferError
Diffstat (limited to 'src/libstore/http-binary-cache-store.cc')
-rw-r--r--src/libstore/http-binary-cache-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc
index 9a19af5e0..5e446ddf2 100644
--- a/src/libstore/http-binary-cache-store.cc
+++ b/src/libstore/http-binary-cache-store.cc
@@ -89,7 +89,7 @@ protected:
request.head = true;
getDataTransfer()->download(request);
return true;
- } catch (DownloadError & e) {
+ } catch (DataTransferError & e) {
/* S3 buckets return 403 if a file doesn't exist and the
bucket is unlistable, so treat 403 as 404. */
if (e.error == DataTransfer::NotFound || e.error == DataTransfer::Forbidden)
@@ -108,7 +108,7 @@ protected:
req.mimeType = mimeType;
try {
getDataTransfer()->download(req);
- } catch (DownloadError & e) {
+ } catch (DataTransferError & e) {
throw UploadToHTTP("while uploading to HTTP binary cache at '%s': %s", cacheUri, e.msg());
}
}
@@ -125,7 +125,7 @@ protected:
auto request(makeRequest(path));
try {
getDataTransfer()->download(std::move(request), sink);
- } catch (DownloadError & e) {
+ } catch (DataTransferError & e) {
if (e.error == DataTransfer::NotFound || e.error == DataTransfer::Forbidden)
throw NoSuchBinaryCacheFile("file '%s' does not exist in binary cache '%s'", path, getUri());
maybeDisable();
@@ -146,7 +146,7 @@ protected:
{[callbackPtr, this](std::future<DataTransferResult> result) {
try {
(*callbackPtr)(result.get().data);
- } catch (DownloadError & e) {
+ } catch (DataTransferError & e) {
if (e.error == DataTransfer::NotFound || e.error == DataTransfer::Forbidden)
return (*callbackPtr)(std::shared_ptr<std::string>());
maybeDisable();