{"record":{"id":"bd750219f1b4c7b9","repo":"chenhg5/cc-connect","slug":"s-get-w","errorCode":null,"errorMessage":"%s: get: %w","messagePattern":"(.+?): get: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/weixin/cdn.go","lineNumber":135,"sourceCode":"\nfunc buildCdnUploadURL(cdnBase, uploadParam, filekey string) string {\n\treturn fmt.Sprintf(\"%s/upload?encrypted_query_param=%s&filekey=%s\",\n\t\tstrings.TrimRight(cdnBase, \"/\"),\n\t\turl.QueryEscape(uploadParam),\n\t\turl.QueryEscape(filekey))\n}\n\nfunc fetchCdnBytes(ctx context.Context, client *http.Client, fullURL, label string) ([]byte, error) {\n\tif client == nil {\n\t\tclient = http.DefaultClient\n\t}\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, fullURL, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: new request: %w\", label, err)\n\t}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: get: %w\", label, err)\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := io.ReadAll(io.LimitReader(resp.Body, maxWeixinMediaBytes+1))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"%s: read: %w\", label, err)\n\t}\n\tif len(body) > maxWeixinMediaBytes {\n\t\treturn nil, fmt.Errorf(\"%s: CDN body exceeds %d bytes\", label, maxWeixinMediaBytes)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"%s: CDN http %d: %s\", label, resp.StatusCode, truncateForLog(body, 256))\n\t}\n\treturn body, nil\n}\n\nfunc downloadAndDecryptCDN(ctx context.Context, client *http.Client, cdnBase, encParam, aesKeyBase64, label string) ([]byte, error) {\n\tkey, err := parseAesKey(aesKeyBase64, label)\n\tif err != nil {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/weixin/cdn.go#L117-L153","documentation":"The HTTP client failed to execute the CDN GET request in fetchCdnBytes — a transport-level failure (connection refused/reset, DNS, timeout, or context cancellation) while downloading Weixin CDN media bytes, before any status code was received.","triggerScenarios":"Thrown at platform/weixin/cdn.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download with limited attempts and backoff; CDN endpoints are often transiently unavailable","Configure a reasonable timeout on the http.Client used for CDN fetches","Abort cleanly when the parent context is cancelled (user message flow already torn down)"],"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"}