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) } }