{"record":{"id":"930e00d8fa9ae470","repo":"chenhg5/cc-connect","slug":"wecom-send-markdown-w","errorCode":null,"errorMessage":"wecom: send markdown: %w","messagePattern":"wecom: send markdown: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/wecom/wecom.go","lineNumber":607,"sourceCode":"\nvar _ core.ImageSender = (*Platform)(nil)\n\nfunc (p *Platform) sendMarkdown(accessToken, toUser, content string) error {\n\tpayload := map[string]any{\n\t\t\"touser\":   toUser,\n\t\t\"msgtype\":  \"markdown\",\n\t\t\"agentid\":  p.agentID,\n\t\t\"markdown\": map[string]string{\"content\": content},\n\t}\n\n\tbody, _ := json.Marshal(payload)\n\tapiURL := p.wecomAPIURL(\"/cgi-bin/message/send\", url.Values{\n\t\t\"access_token\": []string{accessToken},\n\t})\n\n\tresp, err := p.apiClient.Post(apiURL, \"application/json\", strings.NewReader(string(body)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"wecom: send markdown: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tvar result struct {\n\t\tErrCode int    `json:\"errcode\"`\n\t\tErrMsg  string `json:\"errmsg\"`\n\t}\n\tif err := json.NewDecoder(resp.Body).Decode(&result); err != nil {\n\t\treturn fmt.Errorf(\"wecom: decode send response: %w\", err)\n\t}\n\tif result.ErrCode != 0 {\n\t\treturn fmt.Errorf(\"wecom: send markdown failed: %d %s\", result.ErrCode, result.ErrMsg)\n\t}\n\treturn nil\n}\n\nfunc (p *Platform) sendText(accessToken, toUser, text string) error {\n\tpayload := map[string]any{","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/wecom/wecom.go#L589-L625","documentation":"Transport-level failure of POST /cgi-bin/message/send with the markdown payload (used by Reply): the HTTP request itself failed — network unreachable, connection reset, TLS or timeout — before any status or errcode was seen. It is the markdown counterpart of the image send path's transport wrap.","triggerScenarios":"Thrown at platform/wecom/wecom.go:607 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the send with backoff; markdown sends are idempotent from the user's perspective","Verify network/proxy connectivity to qyapi.weixin.qq.com","If it recurs for all sends, check DNS and firewall on the host"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}