{"record":{"id":"b2d7bb75656c53b5","repo":"chenhg5/cc-connect","slug":"dingtalk-reply-returned-status-d","errorCode":null,"errorMessage":"dingtalk: reply returned status %d","messagePattern":"dingtalk: reply returned status (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/dingtalk/dingtalk.go","lineNumber":835,"sourceCode":"\tbody, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"dingtalk: marshal reply: %w\", err)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, rc.sessionWebhook, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"dingtalk: create request: %w\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := core.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"dingtalk: send reply: %w\", err)\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"dingtalk: reply returned status %d\", resp.StatusCode)\n\t}\n\treturn nil\n}\n\nfunc (p *Platform) Reply(ctx context.Context, rctx any, content string) error {\n\trc, ok := rctx.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"dingtalk: invalid reply context type %T\", rctx)\n\t}\n\n\t// Fall back to proactive API when sessionWebhook is unavailable\n\tif rc.proactive || rc.sessionWebhook == \"\" {\n\t\treturn p.sendProactiveMessage(ctx, rc, content)\n\t}\n\n\tatUserIds := extractAtUserIds(content)\n\n\tcontent = preprocessDingTalkMarkdown(content)","sourceCodeStart":817,"sourceCodeEnd":853,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/dingtalk/dingtalk.go#L817-L853","documentation":"DingTalk's session webhook answered the reply POST with a non-200 status. Indicates webhook rejection (expired session webhook, invalid payload, rate limiting); the status code is embedded for diagnosis.","triggerScenarios":"Thrown at platform/dingtalk/dingtalk.go:835 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fall back to proactive send if the webhook expired","Check the response body for sign/keyword rejection reasons"],"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"}