Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive, acd: Tweak logging after changing Fs.Put so that it must cope with existing files

Nick Craig-Woodcc6a776034b2
diff --git a/amazonclouddrive/amazonclouddrive.go b/amazonclouddrive/amazonclouddrive.go
index 8f48d9348..b4eeb8afa 100644
--- a/amazonclouddrive/amazonclouddrive.go
+++ b/amazonclouddrive/amazonclouddrive.go
@@ -240,7 +240,7 @@ func (f *Fs) newFsObjectWithInfo(remote string, info *acd.Node) fs.Object {
} else {
err := o.readMetaData() // reads info and meta, returning an error
if err != nil {
- // logged already FsDebug("Failed to read info: %s", err)
+ fs.Log(o, "Failed to read metadata: %s", err)
return nil
}
}
@@ -624,7 +624,6 @@ func (o *Object) readMetaData() (err error) {
return o.fs.shouldRetry(resp, err)
})
if err != nil {
- fs.Debug(o, "Failed to read info: %s", err)
return err
}
o.info = info.Node
diff --git a/drive/drive.go b/drive/drive.go
index fb285fc94..17926b025 100644
--- a/drive/drive.go
+++ b/drive/drive.go
@@ -360,7 +360,6 @@ func (f *Fs) newFsObjectWithInfoErr(remote string, info *drive.File) (fs.Object,
} else {
err := o.readMetaData() // reads info and meta, returning an error
if err != nil {
- // logged already fs.Debug("Failed to read info: %s", err)
return nil, err
}
}
@@ -371,8 +370,10 @@ func (f *Fs) newFsObjectWithInfoErr(remote string, info *drive.File) (fs.Object,
//
// May return nil if an error occurred
func (f *Fs) newFsObjectWithInfo(remote string, info *drive.File) fs.Object {
- o, _ := f.newFsObjectWithInfoErr(remote, info)
- // Errors have already been logged
+ o, err := f.newFsObjectWithInfoErr(remote, info)
+ if err != nil {
+ fs.Log(o, "Failed to read metadata: %v", err)
+ }
return o
}
@@ -870,7 +871,6 @@ func (o *Object) readMetaData() (err error) {
return err
}
if !found {
- fs.Debug(o, "%v", errorObjectNotFound)
return errorObjectNotFound
}
return nil