mirror of
https://github.com/rclone/rclone
synced 2025-01-07 09:06:24 +01:00
gcs: Check for errors when testing bucket is OK in mkdir #1590
Previously we would check the bucket's status and on error we would try to create it. Now we only try to create it if we got a not found error, otherwise we report the error to the user.
This commit is contained in:
parent
265fb8a5e2
commit
76c5aa8533
@ -578,6 +578,12 @@ func (f *Fs) Mkdir(dir string) error {
|
||||
// Bucket already exists
|
||||
f.bucketOK = true
|
||||
return nil
|
||||
} else if gErr, ok := err.(*googleapi.Error); ok {
|
||||
if gErr.Code != http.StatusNotFound {
|
||||
return errors.Wrap(err, "failed to get bucket")
|
||||
}
|
||||
} else {
|
||||
return errors.Wrap(err, "failed to get bucket")
|
||||
}
|
||||
|
||||
if f.projectNumber == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user