fix(remote download): slave canceled task error is not passed to master in non-debug mode (#2301)

This commit is contained in:
Aaron Liu
2025-04-27 10:38:35 +08:00
parent 2333ed3501
commit a0b4c97db0
2 changed files with 8 additions and 2 deletions

View File

@@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/cloudflare/cfssl/scan/crypto/sha1"
"github.com/cloudreve/Cloudreve/v4/application/constants"
@@ -95,7 +94,7 @@ func (s *slaveDownloader) Info(ctx context.Context, handle *downloader.TaskHandl
// 处理列取结果
if resp.Code != 0 {
err = serializer.NewErrorFromResponse(resp)
if strings.Contains(err.Error(), downloader.ErrTaskNotFount.Error()) {
if resp.Code == serializer.CodeNotFound {
return nil, fmt.Errorf("%s (%w)", err.Error(), downloader.ErrTaskNotFount)
}
return nil, err