Merge pull request #22973 from kreuzerkrieg/Fix_Poco_HTTP_Client

Fix an error handling in Poco HTTP Client for AWS.
This commit is contained in:
Vladimir 2021-04-12 13:40:44 +03:00 committed by GitHub
commit 4f34bc4e73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,7 +259,11 @@ void PocoHTTPClient::makeRequestInternal(
String error_message; String error_message;
Poco::StreamCopier::copyToString(response_body_stream, error_message); Poco::StreamCopier::copyToString(response_body_stream, error_message);
response->SetClientErrorType(Aws::Client::CoreErrors::NETWORK_CONNECTION); if (Aws::Http::IsRetryableHttpResponseCode(response->GetResponseCode()))
response->SetClientErrorType(Aws::Client::CoreErrors::NETWORK_CONNECTION);
else
response->SetClientErrorType(Aws::Client::CoreErrors::USER_CANCELLED);
response->SetClientErrorMessage(error_message); response->SetClientErrorMessage(error_message);
if (status_code == 429 || status_code == 503) if (status_code == 429 || status_code == 503)