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

mega: fix error handling broken by removal of github.com/pkg/errors

Nick Craig-Wood7366e97dfc80
diff --git a/backend/mega/mega.go b/backend/mega/mega.go
index 7b38fdf58..7e154fe2d 100644
--- a/backend/mega/mega.go
+++ b/backend/mega/mega.go
@@ -602,7 +602,10 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error {
return err
}
_, err = f.mkdir(ctx, rootNode, dir)
- return fmt.Errorf("Mkdir failed: %w", err)
+ if err != nil {
+ return fmt.Errorf("Mkdir failed: %w", err)
+ }
+ return nil
}
// deleteNode removes a file or directory, observing useTrash