fix(downloader): improve error handling by converting error to string

pull/3834/head
banbxio 2025-04-02 01:35:38 +08:00
parent 27f0fd9ccb
commit 75caff5f5f
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ func downloadStatusHandler(downloaderCache *cache.Cache) handleFunc {
"url": taskCache.URL, "url": taskCache.URL,
"taskID": taskCache.TaskID.String(), "taskID": taskCache.TaskID.String(),
"status": taskCache.status, "status": taskCache.status,
"error": taskCache.err, "error": fmt.Sprint(taskCache.err),
} }
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(&responseBody) err := json.NewEncoder(w).Encode(&responseBody)