{"record":{"id":"fc78bb16df5479ac","repo":"chenhg5/cc-connect","slug":"dingtalk-send-reply-w","errorCode":null,"errorMessage":"dingtalk: send reply: %w","messagePattern":"dingtalk: send reply: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/dingtalk/dingtalk.go","lineNumber":830,"sourceCode":"\t\tpayload[\"at\"] = map[string]any{\n\t\t\t\"atUserIds\": atUsers,\n\t\t\t\"isAtAll\":   atAll,\n\t\t}\n\t}\n\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)","sourceCodeStart":812,"sourceCodeEnd":848,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/dingtalk/dingtalk.go#L812-L848","documentation":"Wrapped network/transport error from posting the JSON reply payload to the DingTalk session webhook; the request to rc.sessionWebhook itself failed (timeout, DNS, connection refused) before any status code was received.","triggerScenarios":"Thrown at platform/dingtalk/dingtalk.go:830 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["DingTalk session webhooks expire — reply promptly or use proactive send","Retry on transient network failures"],"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-14T05:17:10.506Z"}