{"record":{"id":"74d80240c77679ea","repo":"sipeed/picoclaw","slug":"failed-to-parse-s-w","errorCode":null,"errorMessage":"failed to parse %s: %w","messagePattern":"failed to parse (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/diagnostics.go","lineNumber":127,"sourceCode":"\t\t\t\t\"%s type error at line %d, column %d: expected %s but got %s\\n%s\",\n\t\t\t\tlabel,\n\t\t\t\tline,\n\t\t\t\tcolumn,\n\t\t\t\te.Type.String(),\n\t\t\t\te.Value,\n\t\t\t\tpreview,\n\t\t\t)\n\t\t}\n\t\treturn fmt.Errorf(\n\t\t\t\"%s type error at line %d, column %d: expected %s but got %s\",\n\t\t\tlabel,\n\t\t\tline,\n\t\t\tcolumn,\n\t\t\te.Type.String(),\n\t\t\te.Value,\n\t\t)\n\tdefault:\n\t\treturn fmt.Errorf(\"failed to parse %s: %w\", label, err)\n\t}\n}\n\nfunc splitDiagnosticError(message string) (string, string) {\n\tif idx := strings.IndexByte(message, '\\n'); idx >= 0 {\n\t\treturn message[:idx], message[idx+1:]\n\t}\n\treturn message, \"\"\n}\n\nfunc stripANSISequences(s string) string {\n\tif s == \"\" {\n\t\treturn \"\"\n\t}\n\n\tvar b strings.Builder\n\tb.Grow(len(s))\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/diagnostics.go#L109-L145","documentation":"Default branch of wrapJSONError: the labeled document failed to parse with an error that is neither json.SyntaxError nor json.UnmarshalTypeError (e.g. unexpected EOF or other decoder errors). The original error is preserved via %w for errors.Is/As inspection.","triggerScenarios":"Thrown at pkg/config/diagnostics.go:127 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped inner error for the specific parse failure","Check the file is not empty or truncated","Re-save the file as UTF-8 without BOM and retry"],"exampleFix":null,"handlingStrategy":"try-catch","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"}