You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/10 17:33:40 UTC

[GitHub] [arrow] milesgranger commented on a diff in pull request #14601: ARROW-17985: [C++][Python] Improve s3fs error message when wrong region

milesgranger commented on code in PR #14601:
URL: https://github.com/apache/arrow/pull/14601#discussion_r1019430511


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -2303,10 +2303,14 @@ Result<FileInfo> S3FileSystem::GetFileInfo(const std::string& s) {
     auto outcome = impl_->client_->HeadBucket(req);
     if (!outcome.IsSuccess()) {
       if (!IsNotFound(outcome.GetError())) {
-        return ErrorToStatus(
-            std::forward_as_tuple("When getting information for bucket '", path.bucket,
-                                  "': "),
-            "HeadBucket", outcome.GetError());
+        auto msg = "When getting information for bucket '" + path.bucket + "': ";
+        // Bucket exists, but failed to call HeadBucket, perhaps wrong region?
+        ARROW_ASSIGN_OR_RAISE(auto region, impl_->client_->GetBucketRegion(path.bucket));

Review Comment:
   Ah, it was in the headers after all. :+1: https://github.com/apache/arrow/pull/14601/commits/eccb0b521b7281c6ec09d9793ab2cee3137130bd



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org