{"record":{"id":"3373346b20959b53","repo":"tonhowtf/omniget","slug":"n-o-foi-poss-vel-ler","errorCode":null,"errorMessage":"não foi possível ler {}","messagePattern":"não foi possível ler (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/blogs/mod.rs","lineNumber":196,"sourceCode":"                    let retry = r\n                        .headers()\n                        .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) => return Err(anyhow!(\"HTTP {} em {}\", r.status(), url)),\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    /// GET com JSON de volta. Tolera o prefixo anti-sequestro do Medium.\n    pub async fn get_json(&self, url: &str) -> Result<serde_json::Value> {\n        let text = self.get_text(url).await?;\n        let body = strip_json_prefix(&text);\n        serde_json::from_str(body)\n            .map_err(|e| anyhow!(\"o servidor respondeu algo que não é JSON ({}): {}\", e, url))\n    }\n}\n\n/// O Medium serve JSON prefixado com `])}while(1);</x>` para que ninguém\n/// consiga incluir a resposta como `<script>`. É lixo antes do primeiro `{`\n/// ou `[`; cortar é obrigatório antes de parsear.\npub fn strip_json_prefix(text: &str) -> &str {\n    let t = text.trim_start();\n    if t.starts_with('{') || t.starts_with('[') {\n        return t;","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/blogs/mod.rs#L178-L214","documentation":"After exhausting all TRIES retry attempts because of network-level errors (connection failures, timeouts, reqwest::Error), get_text() falls through the loop and returns this generic failure naming the URL. It means the body could never be retrieved at the transport level.","triggerScenarios":"All retry attempts in get_text ended with Err(e) from client.get(url).send() (DNS failure, connection refused/reset, TLS error, timeout), so control reaches the final Err(anyhow!(\"não foi possível ler {}\")) after the loop.","commonSituations":"No internet / DNS misconfiguration; corporate firewall blocking medium.com; server dropping connections; proxy misconfiguration; long outage exceeding the retry budget.","solutions":["Check internet connectivity and DNS resolution for the host","Retry later if the site is down","Check proxy/VPN/firewall settings that may block the connection","Increase retry patience or run again on a more stable network"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fetcher.get_text(url).await {\n    Err(e) if e.to_string().contains(\"não foi possível ler\") => {\n        if online() { return fetcher.get_text(url).await; }\n        return Err(e);\n    }\n    other => other,\n}","preventionTips":["Check network/DNS before long exports","Configure sane timeouts in the reqwest client","Run exports on stable connections; avoid flaky proxies"],"tags":["network","connection","retry"],"backgroundTag":"network-request-failed","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"}