Skip to content

Commit

Permalink
Update allowed expected errors when getitng tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Gilmer committed Nov 8, 2019
1 parent e96e42b commit eb0862c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clamav.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ def md5_from_s3_tags(s3_client, bucket, key):
try:
tags = s3_client.get_object_tagging(Bucket=bucket, Key=key)["TagSet"]
except botocore.exceptions.ClientError as e:
expected_errors = {"404", "AccessDenied", "NoSuchKey"}
expected_errors = {
"404", # Object does not exist
"AccessDenied", # Object cannot be accessed
"NoSuchKey", # Object does not exist
"MethodNotAllowed", # Object deleted in bucket with versioning
}
if e.response["Error"]["Code"] in expected_errors:
return ""
else:
Expand Down

0 comments on commit eb0862c

Please sign in to comment.