{"record":{"id":"3677e53941c7bd52","repo":"Flow-Launcher/Flow.Launcher","slug":"error-code-response-statuscode-returned-from","errorCode":null,"errorMessage":"Error code <{response.StatusCode}> returned from <{url}>","messagePattern":"Error code <(.+?)> returned from <(.+?)>","errorType":"exception","errorClass":"HttpRequestException","httpStatus":null,"severity":"error","filePath":"Flow.Launcher.Infrastructure/Http/Http.cs","lineNumber":131,"sourceCode":"\n                            if (token.IsCancellationRequested)\n                                return;\n                            else\n                                reportProgress(progressValue);\n                        }\n\n                        if (progressValue < 100)\n                            reportProgress(100);\n                    }\n                    else\n                    {\n                        await using var fileStream = new FileStream(filePath, FileMode.CreateNew);\n                        await response.Content.CopyToAsync(fileStream, token);\n                    }\n                }\n                else\n                {\n                    throw new HttpRequestException($\"Error code <{response.StatusCode}> returned from <{url}>\");\n                }\n            }\n            catch (HttpRequestException e)\n            {\n                Log.Exception(ClassName, \"Http Request Error\", e, \"DownloadAsync\");\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Asynchrously get the result as string from url.\n        /// When supposing the result larger than 83kb, try using GetStreamAsync to avoid reading as string\n        /// </summary>\n        /// <param name=\"url\"></param>\n        /// <returns>The Http result as string. Null if cancellation requested</returns>\n        public static Task<string> GetAsync([NotNull] string url, CancellationToken token = default)\n        {\n            Log.Debug(ClassName, $\"Url <{url}>\");","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Flow-Launcher/Flow.Launcher/blob/7fc63b07bbaa10a0f0b2601487913fcba9ed24b0/Flow.Launcher.Infrastructure/Http/Http.cs#L113-L149","documentation":"Thrown as HttpRequestException inside DownloadAsync when the HTTP response status code is not a success (response.IsSuccessStatusCode is false) while attempting to download a file to disk. It is caught by the local catch which logs 'Http Request Error' and rethrows, so callers see the exception. Unlike GetAsync, the response body is NOT captured — only the status code and URL are in the message.","triggerScenarios":"Plugin/metadata download URL returns 404 (file removed), 403 (hotlinking blocked), 500/503 (server error), 401 (auth required); the update server is behind a CDN that rate-limits with a 429; a redirect chain ends in an error code because HttpClient doesn't follow cross-scheme or certain redirect types.","commonSituations":"Plugin author moved or deleted the release asset but didn't update the manifest URL; corporate proxy returns 407/502; GitHub rate limiting on raw.githubusercontent or release downloads; the host is offline and a captive portal returns 200/302 to a login page (note: 200 wouldn't throw, but a portal returning 4xx would).","solutions":["Open the URL in a browser to see the actual status/body — the message gives you the code and endpoint.","Check whether the download host is up and the path still exists (common for GitHub release assets that were re-published).","Retry with backoff for transient 5xx/429 codes.","If behind a proxy, ensure HttpClient.DefaultProxy / system proxy is configured correctly.","For 403/401, verify the URL doesn't require authentication or an accept header."],"exampleFix":"// before\nif (!response.IsSuccessStatusCode)\n    throw new HttpRequestException($\"Error code <{response.StatusCode}> returned from <{url}>\");\n\n// after — include body and retry on transient codes\nif (!response.IsSuccessStatusCode)\n{\n    var body = await response.Content.ReadAsStringAsync(token);\n    throw new HttpRequestException(\n        $\"{(int)response.StatusCode} {response.StatusCode} from <{url}>: {body}\");\n}","handlingStrategy":"retry","validationCode":"null","typeGuard":"null","tryCatchPattern":"int attempt = 0;\nretry:\ntry { await Http.DownloadAsync(url, filePath, token); }\ncatch (HttpRequestException ex) when ((int)ex.StatusCode >= 500 && ++attempt < 3)\n{ await Task.Delay(TimeSpan.FromSeconds(1 << attempt), token); goto retry; }","preventionTips":["Verify the download URL returns 200 in a browser before relying on it.","Implement retry with backoff for transient 5xx/429 responses.","Configure the system proxy / HttpClient.DefaultProxy in corporate environments.","Log the status code to distinguish missing (404) from server (5xx) failures."],"tags":["http","network","download","status-code"],"backgroundTag":null,"analyzedSha":"7fc63b07bbaa10a0f0b2601487913fcba9ed24b0","analyzedAt":"2026-08-13T14:54:20.914Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}