Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add S3 head_bucket helper #21

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Add S3 head_bucket helper #21

merged 1 commit into from
Oct 31, 2024

Conversation

bbayles
Copy link
Collaborator

@bbayles bbayles commented Oct 30, 2024

This PR adds a new helper, boto3_helpers.s3.head_bucket.

The boto3 docs, as of this writing, list S3.Client.exceptions.NoSuchBucket as the only exception that the S3 client's head_bucket will raise.

Alas, this issue and others correctly note that this does exception does not get raised if you ask for a bucket that does not exist. A generic ClientError is raised instead.

image

This new function actually raises the correct exception.

CC: @bphamwurl

@bbayles bbayles merged commit d6d0a5f into main Oct 31, 2024
5 checks passed
@bbayles bbayles deleted the s3-head-bucket branch October 31, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant