MCPcopy Create free account
hub / github.com/apache/arrow / BucketRegionFromError

Function BucketRegionFromError

cpp/src/arrow/filesystem/s3_internal.h:85–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84template <typename ErrorType>
85inline std::optional<std::string> BucketRegionFromError(
86 const Aws::Client::AWSError<ErrorType>& error) {
87 if constexpr (std::is_same_v<ErrorType, Aws::S3::S3Errors>) {
88 const auto& headers = error.GetResponseHeaders();
89 const auto it = headers.find("x-amz-bucket-region");
90 if (it != headers.end()) {
91 const std::string region(it->second.begin(), it->second.end());
92 return region;
93 }
94 }
95 return std::nullopt;
96}
97
98inline bool IsNotFound(const Aws::Client::AWSError<Aws::S3::S3Errors>& error) {
99 const auto error_type = error.GetErrorType();

Callers 1

ErrorToStatusFunction · 0.85

Calls 3

findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected