Skip to content

Commit

Permalink
Fix checking HTTP status code for boto3 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Mar 13, 2024
1 parent 0b835a8 commit 0b6e28c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion olmo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def _s3_get_bytes_range(
.read()
)
except boto_exceptions.ClientError as e:
if int(e.response["Error"]["Code"]) == 404:
if e.response["ResponseMetadata"]["HTTPStatusCode"] == 404:
raise FileNotFoundError(f"s3://{bucket_name}/{key}") from e
err = e
except (boto_exceptions.HTTPClientError, boto_exceptions.ConnectionError) as e:
Expand Down

0 comments on commit 0b6e28c

Please sign in to comment.