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

Raise not exists error when attempting to get size for unexisting S3 file #1309

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

sevdog
Copy link
Contributor

@sevdog sevdog commented Sep 28, 2023

As of now, attempting to get the file size from S3Storage always raises a botocore.ClientError, which is vague and may not fall under existing file-management related error handling.

Since may other methods in S3 storage already implement this kind of logic I have put the same in the S3Storage.size method. Now if the S3 error is a "not found" a more explanatory FileNotFoundError is raised instead.

@jschneier
Copy link
Owner

Closes #1022

@jschneier jschneier merged commit cf33d69 into jschneier:master Sep 29, 2023
15 checks passed
@jschneier
Copy link
Owner

Thanks

@sevdog sevdog deleted the s3-non-exists-size branch September 29, 2023 07:40
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.

2 participants