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

There were instances of errors.Wrap being called with a nil error
which the conversion didn't deal with correctly.
This commit is contained in:
Nick Craig-Wood 2021-11-09 13:00:51 +00:00
parent 21ba4d9a18
commit 7366e97dfc

View File

@ -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