{"record":{"id":"3dad5fbc20d18dd0","repo":"xpzouying/xiaohongshu-mcp","slug":"error-3dad5f","errorCode":null,"errorMessage":"检查正文长度元素失败","messagePattern":"检查正文长度元素失败","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xiaohongshu/publish.go","lineNumber":620,"sourceCode":"\t\treturn errors.Wrap(err, \"检查标题长度元素失败\")\n\t}\n\n\tif !has {\n\t\treturn nil\n\t}\n\n\ttitleLength, err := elem.Text()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"获取标题长度文本失败\")\n\t}\n\n\treturn makeMaxLengthError(titleLength)\n}\n\nfunc checkContentMaxLength(page *rod.Page) error {\n\thas, elem, err := page.Has(`div.edit-container div.length-error`)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"检查正文长度元素失败\")\n\t}\n\n\tif !has {\n\t\treturn nil\n\t}\n\n\tcontentLength, err := elem.Text()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"获取正文长度文本失败\")\n\t}\n\n\treturn makeMaxLengthError(contentLength)\n}\n\nfunc makeMaxLengthError(elemText string) error {\n\tparts := strings.Split(elemText, \"/\")\n\tif len(parts) != 2 {\n\t\treturn errors.Errorf(\"长度超过限制: %s\", elemText)","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/xiaohongshu/publish.go#L602-L638","documentation":"checkContentMaxLength 用 page.Has 检查正文长度错误元素 div.edit-container div.length-error 时查询报错：DOM 查询本身失败（页面重渲染/导航中），不代表正文超长。","triggerScenarios":"Thrown at xiaohongshu/publish.go:620 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["重试提交","确认发布页仍可交互"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}