aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/filetransfer.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-18 17:54:16 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-04-19 01:44:11 +0000
commit75b62e52600a44b42693944b50638bf580a2c86e (patch)
treedb7edec57a29012095e168d004fbb93c4387c470 /src/libstore/filetransfer.cc
parentb135de2b5f08aa8b549d69371823235124ef04a1 (diff)
Avoid `fmt` when constructor already does it
There is a correctnes issue here, but #3724 will fix that. This is just a cleanup for brevity's sake.
Diffstat (limited to 'src/libstore/filetransfer.cc')
-rw-r--r--src/libstore/filetransfer.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index c46262299..529a41891 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -443,14 +443,13 @@ struct curlFileTransfer : public FileTransfer
: httpStatus != 0
? FileTransferError(err,
std::move(response),
- fmt("unable to %s '%s': HTTP error %d ('%s')",
- request.verb(), request.uri, httpStatus, statusMsg)
- + (code == CURLE_OK ? "" : fmt(" (curl error: %s)", curl_easy_strerror(code)))
- )
+ "unable to %s '%s': HTTP error %d%s",
+ request.verb(), request.uri, httpStatus,
+ code == CURLE_OK ? "" : fmt(" (curl error: %s)", curl_easy_strerror(code)))
: FileTransferError(err,
std::move(response),
- fmt("unable to %s '%s': %s (%d)",
- request.verb(), request.uri, curl_easy_strerror(code), code));
+ "unable to %s '%s': %s (%d)",
+ request.verb(), request.uri, curl_easy_strerror(code), code);
/* If this is a transient error, then maybe retry the
download after a while. If we're writing to a
@@ -704,7 +703,7 @@ struct curlFileTransfer : public FileTransfer
auto s3Res = s3Helper.getObject(bucketName, key);
FileTransferResult res;
if (!s3Res.data)
- throw FileTransferError(NotFound, {}, "S3 object '%s' does not exist", request.uri);
+ throw FileTransferError(NotFound, "S3 object '%s' does not exist", request.uri);
res.data = std::move(*s3Res.data);
callback(std::move(res));
#else