pitrou commented on code in PR #41798:
URL: https://github.com/apache/arrow/pull/41798#discussion_r1617548412
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -601,44 +601,81 @@ class S3Client : public Aws::S3::S3Client {
public:
using Aws::S3::S3Client::S3Client;
+ static inline constexpr auto kBucketRegionHeaderName = "x-amz-bucket-region";
+
+ std::string GetBucketRegionFromHeaders(
+ const Aws::Http::HeaderValueCollection& headers) {
+ const auto it = headers.find(ToAwsString(kBucketRegionHeaderName));
+ if (it != headers.end()) {
+ return std::string(FromAwsString(it->second));
+ }
+ return std::string();
Review Comment:
That's because we return two different error messages depending on the code
path, see the `GetBucketRegionFromHeaders` call sites.
1. When the headers come from a successful response, the error message is
the generic one you propose
2. When the headers come from an error response, we reuse the original error
message.
Does that sound ok?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]