mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
s3: fix FileExists not working in some go versions
This commit is contained in:
11
s3/public.go
11
s3/public.go
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user