瀏覽代碼

Unmarshal Json (#2414)

Log the actual line that caused an error to help debugging
Laurence Jones 2 年之前
父節點
當前提交
93c22f29cf
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/exprhelpers/jsonextract.go

+ 1 - 1
pkg/exprhelpers/jsonextract.go

@@ -174,7 +174,7 @@ func UnmarshalJSON(params ...any) (any, error) {
 
 	err := json.Unmarshal([]byte(jsonBlob), &out)
 	if err != nil {
-		log.Errorf("UnmarshalJSON : %s", err)
+		log.WithField("line", jsonBlob).Errorf("UnmarshalJSON : %s", err)
 		return nil, err
 	}
 	target[key] = out