{"record":{"id":"edcabe7822e747c2","repo":"sipeed/picoclaw","slug":"s-syntax-error-at-line-d-column-d-w","errorCode":null,"errorMessage":"%s syntax error at line %d, column %d: %w","messagePattern":"(.+?) syntax error at line (.+?), column (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/diagnostics.go","lineNumber":79,"sourceCode":"\treturn prefix + \": \" + summary + \"\\n\" + preview\n}\n\nfunc wrapJSONError(data []byte, err error, label string) error {\n\tswitch e := err.(type) {\n\tcase *json.SyntaxError:\n\t\tline, column := lineAndColumnForOffset(data, e.Offset)\n\t\tpreview := diagnosticPreviewForOffset(data, e.Offset)\n\t\tif preview != \"\" {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s syntax error at line %d, column %d: %w\\n%s\",\n\t\t\t\tlabel,\n\t\t\t\tline,\n\t\t\t\tcolumn,\n\t\t\t\terr,\n\t\t\t\tpreview,\n\t\t\t)\n\t\t}\n\t\treturn fmt.Errorf(\"%s syntax error at line %d, column %d: %w\", label, line, column, err)\n\tcase *json.UnmarshalTypeError:\n\t\tline, column := lineAndColumnForOffset(data, e.Offset)\n\t\tpreview := diagnosticPreviewForOffset(data, e.Offset)\n\t\tfield := strings.TrimSpace(e.Field)\n\t\tif field != \"\" {\n\t\t\tif preview != \"\" {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"%s type error at line %d, column %d for field %q: expected %s but got %s\\n%s\",\n\t\t\t\t\tlabel,\n\t\t\t\t\tline,\n\t\t\t\t\tcolumn,\n\t\t\t\t\tfield,\n\t\t\t\t\te.Type.String(),\n\t\t\t\t\te.Value,\n\t\t\t\t\tpreview,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn fmt.Errorf(","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/diagnostics.go#L61-L97","documentation":"Same json.SyntaxError path in wrapJSONError but when no preview text can be extracted: the message still reports the exact line and column of the syntax error in the labeled document (e.g. config.json). A pure parse-failure wrapper, not a semantic validation.","triggerScenarios":"Thrown at pkg/config/diagnostics.go:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the file at the reported line/column and fix the JSON syntax","Run the file through a JSON validator","Restore the config from backup if editing is risky"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}