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

onedrive: report any list errors during cleanup

albertonyc1586a986609
diff --git a/.golangci.yml b/.golangci.yml
index 5352490bc..55de4e945 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -44,20 +44,6 @@ issues:
- staticcheck
text: 'SA6002: argument should be pointer-like to avoid allocations'
- # TODO: Investigate if this is a real issue. If not, i.e. it is a false
- # positive, consider instead excluding this check using a code comment!
- - path: ^backend[\\/]onedrive[\\/]onedrive\.go$
- linters:
- - staticcheck
- text: 'SA4009: argument err is overwritten before first use'
-
- # TODO: Investigate if this is a real issue. If not, i.e. it is a false
- # positive, consider instead excluding this check using a code comment!
- - path: ^backend[\\/]onedrive[\\/]onedrive\.go$
- linters:
- - staticcheck
- text: 'SA4009\(related information\): assignment to err'
-
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
# positive, consider instead excluding this check using a code comment!
- path: ^fs[\\/]pacer\.go$
diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go
index 976c8878a..f0483d5f2 100644
--- a/backend/onedrive/onedrive.go
+++ b/backend/onedrive/onedrive.go
@@ -1724,6 +1724,10 @@ func (f *Fs) CleanUp(ctx context.Context) error {
token := make(chan struct{}, f.ci.Checkers)
var wg sync.WaitGroup
err := walk.Walk(ctx, f, "", true, -1, func(path string, entries fs.DirEntries, err error) error {
+ if err != nil {
+ fs.Errorf(f, "Failed to list %q: %v", path, err)
+ return nil
+ }
err = entries.ForObjectError(func(obj fs.Object) error {
o, ok := obj.(*Object)
if !ok {