You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the error response from S3 has this information, I agree it would be good to pass it on. A subclass of FileNotFound would indeed be appropriate, I think.
try:
s3.get_object(Bucket=bucket_name, Key=key, VersionId=version_id)
exceptClientErrorase:
print(f"{e}")
code=e.response['Error']['Code']
print(f"Found error code {code} when trying to getObject {bucket_name}/{key}{version_id}")
I get the error
An error occurred (NoSuchVersion) when calling the GetObject operation: The specified version does not exist.
Found error code NoSuchVersion when trying to getObject <redacted>/<redacted> <redacted>
Would you like to include a change to https://github.com/fsspec/s3fs/blob/main/s3fs/errors.py#L115 or nearby that would do this? I think it should either be a subclass of FileNotFound, or just extend the string message with the extra information.
When one tries to open a file
path
which exists, but provides a non-existentversion_id
, the operation throwsFileNotFoundError
containing thepath
.It would be very helpful to inform that the version was not found despite the file existing.
s3fs/s3fs/errors.py
Line 79 in 5c05414
Perhaps:
or
Thank you for considering!
The text was updated successfully, but these errors were encountered: