{"record":{"id":"e809020a6c827671","repo":"sirupsen/logrus","slug":"failed-to-marshal-fields-to-json-w","errorCode":null,"errorMessage":"failed to marshal fields to JSON, %w","messagePattern":"failed to marshal fields to JSON, %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"json_formatter.go","lineNumber":133,"sourceCode":"\t\t\tdata[f.FieldMap.resolve(FieldKeyFunc)] = funcVal\n\t\t}\n\t\tif fileVal != \"\" {\n\t\t\tdata[f.FieldMap.resolve(FieldKeyFile)] = fileVal\n\t\t}\n\t}\n\n\tb := entry.Buffer\n\tif b == nil {\n\t\tb = new(bytes.Buffer)\n\t}\n\n\tencoder := json.NewEncoder(b)\n\tencoder.SetEscapeHTML(!f.DisableHTMLEscape)\n\tif f.PrettyPrint {\n\t\tencoder.SetIndent(\"\", \"  \")\n\t}\n\tif err := encoder.Encode(data); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to marshal fields to JSON, %w\", err)\n\t}\n\n\treturn b.Bytes(), nil\n}\n","sourceCodeStart":115,"sourceCodeEnd":138,"githubUrl":"https://github.com/sirupsen/logrus/blob/457e372460c7a80ca7c800b51ebeee5362aaa180/json_formatter.go#L115-L138","documentation":"Error \"failed to marshal fields to JSON, %w\" thrown in sirupsen/logrus.","triggerScenarios":"Thrown at json_formatter.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"457e372460c7a80ca7c800b51ebeee5362aaa180","analyzedAt":"2026-08-16T02:52:47.002Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}