diff --git a/assets b/assets index 587e9f2..5e8e63b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 587e9f29cf45c650546191a9a0ce7bac6642af2a +Subproject commit 5e8e63b37895172e162d34a97c4991fb2869ceb3 diff --git a/pkg/downloader/aria2/aria2.go b/pkg/downloader/aria2/aria2.go index 81d0d10..8070d4f 100644 --- a/pkg/downloader/aria2/aria2.go +++ b/pkg/downloader/aria2/aria2.go @@ -139,6 +139,7 @@ func (a *aria2Client) Info(ctx context.Context, handle *downloader.TaskHandle) ( UploadSpeed: uploadSpeed, SavePath: savePath, NumPieces: numPieces, + ErrorMessage: status.ErrorMessage, Hash: status.InfoHash, Files: lo.Map(status.Files, func(item rpc.FileInfo, index int) downloader.TaskFile { index, _ = strconv.Atoi(item.Index) diff --git a/pkg/downloader/downloader.go b/pkg/downloader/downloader.go index 17a44fc..07ab7fc 100644 --- a/pkg/downloader/downloader.go +++ b/pkg/downloader/downloader.go @@ -44,6 +44,7 @@ type ( Files []TaskFile `json:"files,omitempty"` Pieces []byte `json:"pieces,omitempty"` // Hexadecimal representation of the download progress of the peer. The highest bit corresponds to the piece at index 0. NumPieces int `json:"num_pieces,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` } TaskFile struct { diff --git a/pkg/filemanager/workflows/remote_download.go b/pkg/filemanager/workflows/remote_download.go index b833ee8..926b88f 100644 --- a/pkg/filemanager/workflows/remote_download.go +++ b/pkg/filemanager/workflows/remote_download.go @@ -281,7 +281,7 @@ func (m *RemoteDownloadTask) monitor(ctx context.Context, dep dependency.Dep) (t m.ResumeAfter(resumeAfter) return task.StatusSuspending, nil case downloader.StatusUnknown, downloader.StatusError: - return task.StatusError, fmt.Errorf("download task failed with state %q (%w)", status.State, queue.CriticalErr) + return task.StatusError, fmt.Errorf("download task failed with state %q (%w), errorMsg: %s", status.State, queue.CriticalErr, status.ErrorMessage) } m.ResumeAfter(resumeAfter)