diff --git a/sdk/storage/azure-storage-common/src/storage_retry_policy.cpp b/sdk/storage/azure-storage-common/src/storage_retry_policy.cpp index f1d95662c9..4d2e954721 100644 --- a/sdk/storage/azure-storage-common/src/storage_retry_policy.cpp +++ b/sdk/storage/azure-storage-common/src/storage_retry_policy.cpp @@ -15,21 +15,19 @@ namespace Azure { namespace Storage { namespace _internal { >= 400) { const auto& headers = response->GetHeaders(); - auto ite = headers.find("x-ms-copy-source-status-code"); + auto ite = headers.find("x-ms-copy-source-error-code"); if (ite != headers.end()) { - const auto innerStatusCodeInt = std::stoi(ite->second); - const auto innerStatusCode = static_cast(innerStatusCodeInt); - - const bool shouldRetry - = retryOptions.StatusCodes.find(innerStatusCode) != retryOptions.StatusCodes.end(); + const auto& errorCode = ite->second; + const bool shouldRetry = errorCode == "InternalError" || errorCode == "OperationTimedOut" + || errorCode == "ServerBusy"; if (Azure::Core::Diagnostics::_internal::Log::ShouldWrite( Azure::Core::Diagnostics::Logger::Level::Informational)) { Azure::Core::Diagnostics::_internal::Log::Write( Azure::Core::Diagnostics::Logger::Level::Informational, - std::string("x-ms-copy-source-status-code ") + std::to_string(innerStatusCodeInt) + std::string("x-ms-copy-source-error-code ") + errorCode + (shouldRetry ? " will be retried" : " won't be retried")); } if (shouldRetry)