mirror of https://github.com/Xhofe/alist
fix: typo and error handle
parent
55d6434daa
commit
9633af4e25
|
@ -20,7 +20,7 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithMessage(err, "failed get src account")
|
return errors.WithMessage(err, "failed get src account")
|
||||||
}
|
}
|
||||||
dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(srcPath)
|
dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(dstPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithMessage(err, "failed get dst account")
|
return errors.WithMessage(err, "failed get dst account")
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,9 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e
|
||||||
return errors.WithMessage(err, "failed to get src object")
|
return errors.WithMessage(err, "failed to get src object")
|
||||||
}
|
}
|
||||||
dstDir, err := Get(ctx, account, stdpath.Dir(dstPath))
|
dstDir, err := Get(ctx, account, stdpath.Dir(dstPath))
|
||||||
|
if err != nil {
|
||||||
|
return errors.WithMessage(err, "failed to get dst dir")
|
||||||
|
}
|
||||||
return account.Move(ctx, srcObj, dstDir)
|
return account.Move(ctx, srcObj, dstDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue