test(aria2): download and transfer file

This commit is contained in:
Noah Hsu
2022-06-23 17:06:17 +08:00
parent ffdb198247
commit aedcae840d
3 changed files with 81 additions and 4 deletions

View File

@ -25,13 +25,13 @@ func AddURI(ctx context.Context, uri string, dstDirPath string) error {
// check path is valid
obj, err := operations.Get(ctx, account, dstDirActualPath)
if err != nil {
if !errs.IsErrObjectNotFound(err) {
if !errs.IsObjectNotFound(err) {
return errors.WithMessage(err, "failed get object")
}
} else {
if !obj.IsDir() {
// can't add to a file
return errors.WithStack(errs.ErrNotFolder)
return errors.WithStack(errs.NotFolder)
}
}
// call aria2 rpc