pitrou commented on code in PR #14019:
URL: https://github.com/apache/arrow/pull/14019#discussion_r963728083


##########
cpp/src/arrow/filesystem/s3_internal.h:
##########
@@ -152,10 +152,14 @@ Status ErrorToStatus(const std::string& prefix, const 
std::string& operation,
   // XXX Handle fine-grained error types
   // See
   // 
https://sdk.amazonaws.com/cpp/api/LATEST/namespace_aws_1_1_s3.html#ae3f82f8132b619b6e91c88a9f1bde371
-  return Status::IOError(
-      prefix, "AWS Error ",
-      S3ErrorToString(static_cast<Aws::S3::S3Errors>(error.GetErrorType())), " 
during ",
-      operation, " operation: ", error.GetMessage());
+  auto error_type = static_cast<Aws::S3::S3Errors>(error.GetErrorType());
+  std::stringstream ss;
+  ss << S3ErrorToString(error_type);
+  if (error_type == Aws::S3::S3Errors::UNKNOWN) {
+    ss << " (http status " << static_cast<int>(error.GetResponseCode()) << ")";

Review Comment:
   ```suggestion
       ss << " (HTTP status " << static_cast<int>(error.GetResponseCode()) << 
")";
   ```



-- 
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]

Reply via email to