From 3e9c5eca3bfb3a4d3203126d4b26004fea78146f Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Sat, 2 Jul 2022 16:33:04 +0200 Subject: [PATCH] yandex: handle api error on server-side move --- backend/yandex/yandex.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go index 3097a8bc9..7f0ddc5d8 100644 --- a/backend/yandex/yandex.go +++ b/backend/yandex/yandex.go @@ -782,11 +782,10 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string } _, err = f.readMetaDataForPath(ctx, dstPath, &api.ResourceInfoRequestOptions{}) - if _, ok := err.(*api.ErrorResponse); ok { - // does not exist - //if apiErr.ErrorName == "DiskNotFoundError" { - // // OK - //} + if apiErr, ok := err.(*api.ErrorResponse); ok { + if apiErr.ErrorName != "DiskNotFoundError" { + return err + } } else if err != nil { return err } else {