Skip to content

Commit

Permalink
s3: when file does not exist, handle generic 404 error for headobject
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Nov 11, 2024
1 parent c9711f7 commit bc9d5d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helpers/data_backend/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def exists(self, s3_key):
except (NoCredentialsError, PartialCredentialsError) as e:
raise e # Raise credential errors to the caller
except Exception as e:
if "An error occurred (404) when calling the HeadObject operation: Not Found" in str(e):
return False
logger.error(f'Error checking existence of S3 key "{s3_key}": {e}')
if i == self.read_retry_limit - 1:
# We have reached our maximum retry count.
Expand Down

0 comments on commit bc9d5d9

Please sign in to comment.