{"record":{"id":"e464cf6ac21af138","repo":"sipeed/picoclaw","slug":"s-syntax-error-at-line-d-column-d-w-n-s","errorCode":null,"errorMessage":"%s syntax error at line %d, column %d: %w\\n%s","messagePattern":"(.+?) syntax error at line (.+?), column (.+?): %w\\\\n(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/diagnostics.go","lineNumber":70,"sourceCode":"\tif preview == \"\" {\n\t\tif summary == \"\" {\n\t\t\treturn prefix\n\t\t}\n\t\treturn prefix + \": \" + summary\n\t}\n\tif summary == \"\" {\n\t\treturn prefix + \"\\n\" + preview\n\t}\n\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,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/diagnostics.go#L52-L88","documentation":"Formatted by wrapJSONError for a json.SyntaxError with an available context preview: the config JSON is malformed (missing brace/comma, stray character). The error pinpoints the line and column of the failing offset and appends a preview of the offending text.","triggerScenarios":"Thrown at pkg/config/diagnostics.go:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the JSON at the reported line/column (usually a missing comma, brace, or quote)","Validate config.json with a JSON linter or jq","Restore from the dated .bak backup if the file was corrupted"],"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"}