aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/s3-binary-cache-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r--src/libstore/s3-binary-cache-store.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index f43581bf6..9fc6da9bf 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -32,8 +32,10 @@ namespace nix {
struct S3Error : public Error
{
Aws::S3::S3Errors err;
- S3Error(Aws::S3::S3Errors err, const FormatOrString & fs)
- : Error(fs), err(err) { };
+
+ template<typename... Args>
+ S3Error(Aws::S3::S3Errors err, const Args & ... args)
+ : Error(args...), err(err) { };
};
/* Helper: given an Outcome<R, E>, return R in case of success, or
@@ -109,7 +111,9 @@ class RetryStrategy : public Aws::Client::DefaultRetryStrategy
auto retry = Aws::Client::DefaultRetryStrategy::ShouldRetry(error, attemptedRetries);
if (retry)
printError("AWS error '%s' (%s), will retry in %d ms",
- error.GetExceptionName(), error.GetMessage(), CalculateDelayBeforeNextRetry(error, attemptedRetries));
+ error.GetExceptionName(),
+ error.GetMessage(),
+ CalculateDelayBeforeNextRetry(error, attemptedRetries));
return retry;
}
};
@@ -249,7 +253,7 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
// If bucket listing is disabled, 404s turn into 403s
|| error.GetErrorType() == Aws::S3::S3Errors::ACCESS_DENIED)
return false;
- throw Error(format("AWS error fetching '%s': %s") % path % error.GetMessage());
+ throw Error("AWS error fetching '%s': %s", path, error.GetMessage());
}
return true;