s3: fix detection of BucketAlreadyOwnedByYou and BucketAlreadyExists error
This was being silently ignored until this commit
e2bf91452a
s3: report errors on bucket creation (mkdir) correctly
This commit is contained in:
parent
86eaf43b00
commit
f8039deb7c
1 changed files with 2 additions and 2 deletions
|
@ -1733,8 +1733,8 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fs.Infof(f, "Bucket %q created with ACL %q", bucket, f.opt.BucketACL)
|
fs.Infof(f, "Bucket %q created with ACL %q", bucket, f.opt.BucketACL)
|
||||||
}
|
}
|
||||||
if err, ok := err.(awserr.Error); ok {
|
if awsErr, ok := err.(awserr.Error); ok {
|
||||||
if err.Code() == "BucketAlreadyOwnedByYou" {
|
if code := awsErr.Code(); code == "BucketAlreadyOwnedByYou" || code == "BucketAlreadyExists" {
|
||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue