s3: fix FileExists not working in some go versions

This commit is contained in:
André Roth
2024-01-02 14:58:16 +01:00
parent 92e16c81df
commit 7b7ebc5711

View File

@@ -491,6 +491,17 @@ func (storage *PublishedStorage) FileExists(path string) (bool, error) {
return false, nil
}
// falback in case the above condidition fails
var opErr *smithy.OperationError
if errors.As(err, &opErr) {
var ae smithy.APIError
if errors.As(err, &ae) {
if (ae.ErrorCode() == "NotFound") {
return false, nil
}
}
}
return false, err
}