{"record":{"id":"db2341b54e2afe1b","repo":"tonhowtf/omniget","slug":"http-em-db2341","errorCode":null,"errorMessage":"HTTP {} em {}","messagePattern":"HTTP (.+?) em (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/reddit/mod.rs","lineNumber":459,"sourceCode":"                        .get(reqwest::header::RETRY_AFTER)\n                        .and_then(|v| v.to_str().ok())\n                        .and_then(|v| v.trim().parse::<u64>().ok())\n                        .map(Duration::from_secs);\n                    tokio::time::sleep(retry.unwrap_or(wait)).await;\n                    wait *= 2;\n                }\n                Ok(r) if r.status().as_u16() == 403 => {\n                    return Err(anyhow!(\n                        \"o Reddit barrou o acesso público (403). Costuma ser bloqueio de rede ou conteúdo restrito: tente de outra conexão\"\n                    ));\n                }\n                Ok(r) if r.status().as_u16() == 404 => {\n                    return Err(anyhow!(\n                        \"post não encontrado (apagado, privado ou id errado)\"\n                    ));\n                }\n                Ok(r) => {\n                    return Err(anyhow!(\"HTTP {} em {}\", r.status(), url));\n                }\n                Err(e) if attempt < TRIES => {\n                    tokio::time::sleep(wait).await;\n                    wait *= 2;\n                    let _ = e;\n                }\n                Err(e) => return Err(e.into()),\n            }\n        }\n        Err(anyhow!(\"não foi possível ler {}\", url))\n    }\n\n    /// Segue os redirecionamentos de um link curto e devolve a URL final.\n    pub async fn resolve(&self, url: &str) -> Result<String> {\n        self.pace().await;\n        self.requests.fetch_add(1, Ordering::Relaxed);\n        let r = self.client.get(url).send().await?;\n        Ok(r.url().to_string())","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/reddit/mod.rs#L441-L477","documentation":"`Fetcher::get_json` retries the HTTP request up to TRIES times and fails with this error whenever Reddit returns any non-404 non-success status. The message embeds the status code and the requested URL so the caller can see which endpoint refused the request. It is thrown after all retries were consumed (or immediately, since only 429/5xx-style paths retry via the Err arm).","triggerScenarios":"Calling get_json (directly or via thread/thread_from_fixture flows) when Reddit responds with a status other than 200 or 404 — e.g. 403 (blocked/private), 429 (rate limited past all retries), 5xx (Reddit outage) — after the retry loop in src-tauri/omniget-core/src/core/tools/reddit/mod.rs:459 exhausts TRIES.","commonSituations":"Hitting Reddit too aggressively (rate limit 429), Reddit partial outages (502/503), requests from blocked/datacenter IPs getting 403, or querying quarantined/private subs.","solutions":["Inspect the status code in the message: 429 means slow down — increase backoff or reduce request rate","If 403/418, use authenticated OAuth headers or a different IP (datacenter IPs are often blocked by Reddit)","Retry later if 5xx — it is usually a transient Reddit-side outage","Wrap the call so 404 (handled earlier) vs other statuses are reported distinctly to the user"],"exampleFix":"// before\nlet json = fetcher.get_json(&url).await?;\n// after\nlet json = fetcher.get_json(&url).await.map_err(|e| {\n    eprintln!(\"falha ao buscar {}: {}\", url, e);\n    e\n})?;","handlingStrategy":"retry","validationCode":"// nothing to check locally; optionally verify reachability first\nif reqwest::get(\"https://www.reddit.com\").await.is_err() {\n    anyhow::bail!(\"sem acesso ao Reddit\");\n}","typeGuard":null,"tryCatchPattern":"match fetcher.get_json(&url).await {\n    Ok(v) => v,\n    Err(e) if e.to_string().contains(\"HTTP 429\") => {\n        tokio::time::sleep(Duration::from_secs(30)).await;\n        fetcher.get_json(&url).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Respect rate limits: keep the Fetcher's pacing enabled and lower concurrency","Use authenticated OAuth requests when possible to get higher limits","Monitor for 429/5xx statuses in the message and back off exponentially","Avoid datacenter IPs that Reddit blocks with 403"],"tags":["http","network","reddit","retry-exhausted"],"backgroundTag":"http-error-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}