mirror of
https://github.com/NixOS/nix
synced 2025-06-25 02:21:16 +02:00
Merge pull request #12007 from mupdt/s3-binary-cache-error-request-id
s3-binary-cache: show the error's request ID
This commit is contained in:
commit
a8a572b11b
1 changed files with 7 additions and 2 deletions
|
@ -48,7 +48,11 @@ R && checkAws(std::string_view s, Aws::Utils::Outcome<R, E> && outcome)
|
||||||
if (!outcome.IsSuccess())
|
if (!outcome.IsSuccess())
|
||||||
throw S3Error(
|
throw S3Error(
|
||||||
outcome.GetError().GetErrorType(),
|
outcome.GetError().GetErrorType(),
|
||||||
s + ": " + outcome.GetError().GetMessage());
|
fmt(
|
||||||
|
"%s: %s (request id: %s)",
|
||||||
|
s,
|
||||||
|
outcome.GetError().GetMessage(),
|
||||||
|
outcome.GetError().GetRequestId()));
|
||||||
return outcome.GetResultWithOwnership();
|
return outcome.GetResultWithOwnership();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,9 +125,10 @@ class RetryStrategy : public Aws::Client::DefaultRetryStrategy
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
auto retry = Aws::Client::DefaultRetryStrategy::ShouldRetry(error, attemptedRetries);
|
auto retry = Aws::Client::DefaultRetryStrategy::ShouldRetry(error, attemptedRetries);
|
||||||
if (retry)
|
if (retry)
|
||||||
printError("AWS error '%s' (%s), will retry in %d ms",
|
printError("AWS error '%s' (%s; request id: %s), will retry in %d ms",
|
||||||
error.GetExceptionName(),
|
error.GetExceptionName(),
|
||||||
error.GetMessage(),
|
error.GetMessage(),
|
||||||
|
error.GetRequestId(),
|
||||||
CalculateDelayBeforeNextRetry(error, attemptedRetries));
|
CalculateDelayBeforeNextRetry(error, attemptedRetries));
|
||||||
return retry;
|
return retry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue