ARROW-17079: Show HTTP status code for unknown S3 errors (#14019)
ARROW-17079: Show HTTP status code for unknown S3 errors (#14019)

This is the last change I propose to improve our S3 error message.

For certain errors, unfortunately the AWS SDK is doing a poor job in propagating the error and just reports UNKNOWN (see https://github.com/aws/aws-sdk-cpp/blob/1614bce979a201ada1e3436358edb7bd1834b5d6/aws-cpp-sdk-core/source/client/AWSClient.cpp#L77), in these cases the HTTP status code can be an important source to find out what is going wrong (and is also reported by boto3).

This has the downside of cluttering the error message a bit more, but in general this information will be very valuable to diagnose the problem. Given that we now have the API call and the HTTP status error, in general there is good documentation on the internet that helps diagnose the problem.

Before:

> When getting information for key 'test.csv' in bucket 'pcmoritz-test-bucket-arrow-errors': AWS Error UNKNOWN during HeadObject call: No response body.

After:

> When getting information for key 'test.csv' in bucket 'pcmoritz-test-bucket-arrow-errors': AWS Error UNKNOWN **(HTTP status 400)** during HeadObject call: No response body.

Lead-authored-by: Philipp Moritz <1704119893df07a4e254fb2d9b47d88802fe3381@gmail.com>
Co-authored-by: Antoine Pitrou <8ffbbac03241e3002f35c2a1f358cd318666d6e4@free.fr>
Signed-off-by: Antoine Pitrou <9359a4d812173b65a3a0094cd86363e79731a3c2@python.org>
kou/arrow,apache/arrow,kou/arrow,apache/arrow,kou/arrow,kou/arrow,icexelloss/arrow,kou/arrow,icexelloss/arrow,icexelloss/arrow,apache/arrow,apache/arrow,kou/arrow,icexelloss/arrow,apache/arrow,icexelloss/arrow,kou/arrow,apache/arrow,icexelloss/arrow,kou/arrow,icexelloss/arrow,icexelloss/arrow,kou/arrow,kou/arrow,icexelloss/arrow,apache/arrow,apache/arrow,icexelloss/arrow,kou/arrow,kou/arrow,icexelloss/arrow,apache/arrow,icexelloss/arrow,apache/arrow,apache/arrow,kou/arrow,icexelloss/arrow,apache/arrow,icexelloss/arrow,apache/arrow,kou/arrow,apache/arrow