Fix style check

This commit is contained in:
kssenii 2023-05-03 18:28:33 +02:00
parent cb6e5fedc5
commit 0a18a87ad3
2 changed files with 7 additions and 2 deletions

View File

@ -650,6 +650,7 @@
M(679, IO_URING_SUBMIT_ERROR) \
M(690, MIXED_ACCESS_PARAMETER_TYPES) \
M(691, UNKNOWN_ELEMENT_OF_ENUM) \
M(692, AWS_ERROR) \
\
M(999, KEEPER_EXCEPTION) \
M(1000, POCO_EXCEPTION) \

View File

@ -25,6 +25,10 @@ namespace DB::S3
namespace
{
namespace ErrorCodes
{
extern const int AWS_ERROR;
}
bool areCredentialsEmptyOrExpired(const Aws::Auth::AWSCredentials & credentials, uint64_t expiration_window_seconds)
{
@ -143,7 +147,7 @@ Aws::String AWSEC2MetadataClient::getCurrentAvailabilityZone() const
String user_agent_string = awsComputeUserAgentString();
auto [new_token, response_code] = getEC2MetadataToken(user_agent_string);
if (response_code != Aws::Http::HttpResponseCode::OK || new_token.empty())
throw DB::Exception(ErrorCodes::S3_ERROR,
throw DB::Exception(ErrorCodes::AWS_ERROR,
"Failed to token request. HTTP response code: {}", response_code);
token = new_token;
@ -155,7 +159,7 @@ Aws::String AWSEC2MetadataClient::getCurrentAvailabilityZone() const
profile_request->SetUserAgent(user_agent_string);
const auto result = GetResourceWithAWSWebServiceResult(profile_request);
if (result.GetResponseCode() != Aws::Http::HttpResponseCode::OK)
throw DB::Exception(ErrorCodes::S3_ERROR,
throw DB::Exception(ErrorCodes::AWS_ERROR,
"Failed to get availability zone. HTTP response code: {}", result.GetResponseCode());
return Aws::Utils::StringUtils::Trim(result.GetPayload().c_str());
}