1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

DownloadError -> DataTransferError

This commit is contained in:
Nikola Knezevic 2020-04-06 23:00:43 +02:00
parent 213d124277
commit c4c1ae0a00
5 changed files with 14 additions and 14 deletions

View file

@ -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();