{"record":{"id":"755ae4bf63a80516","repo":"tonhowtf/omniget","slug":"nao-foi-possivel-consultar-releases-de-http-github","errorCode":null,"errorMessage":"nao foi possivel consultar releases de {}: HTTP {}","messagePattern":"nao foi possivel consultar releases de (.+?): HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/github.rs","lineNumber":50,"sourceCode":"    pub url: String,\n    pub size: u64,\n    pub digest: Option<String>,\n}\n\n/// Primeiro asset da release `tag` (ou da última) que `pick` aceitar.\npub async fn asset(\n    client: &reqwest::Client,\n    repo: &str,\n    tag: Option<&str>,\n    pick: impl Fn(&str) -> bool,\n) -> anyhow::Result<ReleaseAsset> {\n    let url = match tag {\n        Some(t) => format!(\"https://api.github.com/repos/{}/releases/tags/{}\", repo, t),\n        None => format!(\"https://api.github.com/repos/{}/releases/latest\", repo),\n    };\n    let response = client.get(&url).send().await?;\n    if !response.status().is_success() {\n        return Err(anyhow!(\n            \"nao foi possivel consultar releases de {}: HTTP {}\",\n            repo,\n            response.status()\n        ));\n    }\n    let json: serde_json::Value = response.json().await?;\n    let tag = json[\"tag_name\"].as_str().unwrap_or(\"\").to_string();\n    let assets = json[\"assets\"]\n        .as_array()\n        .ok_or_else(|| anyhow!(\"release de {} sem assets\", repo))?;\n    for a in assets {\n        let name = a[\"name\"].as_str().unwrap_or(\"\");\n        if pick(name) {\n            return Ok(ReleaseAsset {\n                tag: tag.clone(),\n                name: name.to_string(),\n                url: a[\"browser_download_url\"].as_str().unwrap_or(\"\").to_string(),\n                size: a[\"size\"].as_u64().unwrap_or(0),","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/github.rs#L32-L68","documentation":"github::asset() queries the GitHub API releases endpoint (latest or by tag). Any non-success HTTP response from api.github.com aborts with this error including the status. Common causes are a wrong repo slug, 404 (no releases / wrong tag), or 403 rate limiting since unauthenticated API requests are limited to 60/hour.","triggerScenarios":"Calling asset(repo, ...) where the repo slug is misspelled or doesn't exist (404), the tag doesn't exist, or the GitHub token/IP is rate limited (403) or the API is down (5xx).","commonSituations":"Unauthenticated CI machines hitting the 60 req/h rate limit; typo like 'owner/repo ' with whitespace; repository renamed or made private; requesting /releases/latest on a repo with only draft or prerelease-only tags (404).","solutions":["Check the HTTP status in the message: 404 -> fix the repo slug or tag; 403 -> rate limited","Set a GITHUB_TOKEN (via super::client()) to raise the rate limit","List releases to confirm a release exists for the requested tag"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if !repo.matches('/').count() == 1 {\n    return Err(format!(\"repo invalido: '{}', use 'owner/name'\", repo));\n}","typeGuard":null,"tryCatchPattern":"match github::asset(repo, tag, pick).await {\n    Err(e) if e.to_string().contains(\"HTTP 403\") => {\n        eprintln!(\"rate limit do GitHub; configure GITHUB_TOKEN e aguarde\");\n    }\n    Err(e) if e.to_string().contains(\"HTTP 404\") => {\n        eprintln!(\"repo/tag inexistente: verifique '{}' no github.com\", repo);\n    }\n    other => other?,\n}","preventionTips":["Set a GITHUB_TOKEN to avoid the 60 req/h unauthenticated rate limit","Validate the repo slug is exactly 'owner/name' before calling","Cache release lookups in CI to reduce API calls","Handle 404 separately: repo renamed, private, or tag missing"],"tags":["github","api","rate-limit","http"],"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"}