1
0
mirror of https://github.com/rclone/rclone.git synced 2025-03-17 20:27:52 +02:00

gcs: Check for errors when testing bucket is OK in mkdir

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:
Nick Craig-Wood 2017-08-10 10:29:21 +01:00
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 == "" {