libstore/s3: attach more information to error messages
In case of empty messages, it is good to print the raw error code. Additionally, we print request IDs which can help users to reconcile what happened with the service provider. Change-Id: I4d83c011c1b7a5514e3d1b21123df38308279044 Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
@@ -159,11 +159,24 @@ class RetryStrategy : public Aws::Client::DefaultRetryStrategy
|
||||
bool ShouldRetry(const Aws::Client::AWSError<Aws::Client::CoreErrors>& error, long attemptedRetries) const override
|
||||
{
|
||||
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));
|
||||
if (retry) {
|
||||
if (error.GetExceptionName() != "") {
|
||||
printError(
|
||||
"AWS error '%s' (%s) on request ID '%s', will retry in %d ms",
|
||||
error.GetExceptionName(),
|
||||
error.GetMessage(),
|
||||
error.GetRequestId(),
|
||||
CalculateDelayBeforeNextRetry(error, attemptedRetries)
|
||||
);
|
||||
} else {
|
||||
printError(
|
||||
"AWS error (error type: %d) on request ID '%s', will retry in %d ms",
|
||||
error.GetErrorType(),
|
||||
error.GetRequestId(),
|
||||
CalculateDelayBeforeNextRetry(error, attemptedRetries)
|
||||
);
|
||||
}
|
||||
}
|
||||
return retry;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user