From d46f163cfd6f468dfa7bd12f8a324dd13ce4e7f2 Mon Sep 17 00:00:00 2001 From: WangLiZhao <1838393649@qq.com> Date: Mon, 6 Jul 2026 17:34:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(task):=20=E6=94=B9=E8=BF=9B=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/util/mapping.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/util/mapping.go b/common/util/mapping.go index ee61f21..715334a 100644 --- a/common/util/mapping.go +++ b/common/util/mapping.go @@ -263,10 +263,17 @@ func PullTaskResult(ctx context.Context, body map[string]any, queryConfig map[st } if matchStatus(statusStr, statusValues["failed"]) { - g.Log().Errorf(ctx, "[PullTaskResult] 任务失败 taskID=%s", taskID) - return result, fmt.Errorf("任务失败") + errMsg := gconv.String(gjson.New(result).Get("error.message").Val()) + if errMsg == "" { + errMsg = gconv.String(gjson.New(result).Get("error").Val()) + } + if errMsg == "" { + rawBytes, _ := json.Marshal(result) + errMsg = string(rawBytes) + } + g.Log().Errorf(ctx, "[PullTaskResult] 任务失败 taskID=%s err=%s", taskID, errMsg) + return result, fmt.Errorf("任务失败: %s", errMsg) } - time.Sleep(time.Duration(interval) * time.Second) } }