{"record":{"id":"e4374a4d3a312e4d","repo":"chenhg5/cc-connect","slug":"download-returned-http-d","errorCode":null,"errorMessage":"download returned HTTP %d","messagePattern":"download returned HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/update.go","lineNumber":408,"sourceCode":"func downloadToTemp(url string) (string, error) {\n\tclient := &http.Client{\n\t\tTimeout: 5 * time.Minute,\n\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\tif len(via) >= 10 {\n\t\t\t\treturn fmt.Errorf(\"too many redirects\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tresp, err := client.Get(url)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn \"\", fmt.Errorf(\"download returned HTTP %d\", resp.StatusCode)\n\t}\n\n\ttmp, err := os.CreateTemp(\"\", \"cc-connect-update-*\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tsize, err := io.Copy(tmp, resp.Body)\n\tif err != nil {\n\t\ttmp.Close()\n\t\tos.Remove(tmp.Name())\n\t\treturn \"\", fmt.Errorf(\"write: %w\", err)\n\t}\n\ttmp.Close()\n\n\tfmt.Printf(\"Downloaded %.1f MB\\n\", float64(size)/1024/1024)\n\treturn tmp.Name(), nil\n}","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/update.go#L390-L426","documentation":"downloadToTemp received a non-200 HTTP status from the update server (404 for missing release asset, 403 rate-limited, 5xx server error). The update is aborted; the status code identifies why the release asset could not be fetched.","triggerScenarios":"Thrown at cmd/cc-connect/update.go:408 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["For 404: the release asset name may have changed — update cc-connect","For 403/429: GitHub rate limit — wait and retry","Check the releases page to confirm the asset exists"],"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"}