{"record":{"id":"41c624b6e4cc32cf","repo":"tonhowtf/omniget","slug":"http","errorCode":null,"errorMessage":"HTTP {}","messagePattern":"HTTP \\{\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/games/protondb.rs","lineNumber":259,"sourceCode":"    if scan_library {\n        for app in apps {\n            push(app.app_id, app.name.clone(), &mut targets);\n        }\n    }\n    (targets, unresolved)\n}\n\nasync fn fetch(client: &reqwest::Client, app_id: u32) -> anyhow::Result<Option<Summary>> {\n    let resp = client\n        .get(format!(\"{}/{}.json\", API, app_id))\n        .send()\n        .await?;\n    if resp.status() == reqwest::StatusCode::NOT_FOUND {\n        // Jogo sem nenhum relato: o ProtonDB chama isso de \"pending\".\n        return Ok(None);\n    }\n    if !resp.status().is_success() {\n        anyhow::bail!(\"HTTP {}\", resp.status());\n    }\n    let body = resp.text().await?;\n    Ok(Some(parse_summary(&body)?))\n}\n\nfn entry_from(app_id: u32, name: &str, summary: Summary, cached: bool) -> ProtonEntry {\n    let tier = if summary.tier.is_empty() {\n        \"pending\".to_string()\n    } else {\n        summary.tier\n    };\n    let rank = tier_rank(&tier);\n    ProtonEntry {\n        app_id,\n        name: name.to_string(),\n        tier,\n        confidence: summary.confidence,\n        score: summary.score,","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/games/protondb.rs#L241-L277","documentation":"fetch in protondb.rs bails with \"HTTP {}\" when the ProtonDB API (api/v1/reports/summary/{appid}) responds with a non-success status other than 404. A 404 is treated as 'pending' (no reports) and returns Ok(None); any other non-2xx (403, 429, 5xx, etc.) becomes this error. It wraps the raw status code in the message.","triggerScenarios":"Calling run (which calls fetch) for an appid where the ProtonDB endpoint returns an unexpected HTTP error status, e.g. rate limiting (429), server errors (500/502/503), or a rejected/blocked request.","commonSituations":"Hitting ProtonDB too aggressively when scanning a whole Steam library (429); ProtonDB service downtime or maintenance (5xx); network proxies/firewalls returning 403; an invalid appid reaching a different endpoint behavior.","solutions":["Retry the request later or with backoff, especially on 429/5xx (the code already treats 404 as a benign 'pending' result)","Check ProtonDB API status; if the service is down, fall back to cached summaries","Rate-limit or batch requests when scanning entire libraries to avoid throttling","Verify the appid is correct and the request URL is well-formed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No client-side validation prevents server-side HTTP errors; use backoff instead.\n// Treat appids so that 404 (Ok(None)) is expected 'pending', not an error.","typeGuard":null,"tryCatchPattern":"match fetch(app_id, &client).await {\n    Ok(Some(summary)) => use_summary(summary),\n    Ok(None) => mark_pending(app_id), // 404: no reports yet\n    Err(e) if e.to_string().starts_with(\"HTTP 429\") => schedule_retry_with_backoff(app_id),\n    Err(e) if e.to_string().starts_with(\"HTTP 5\") => schedule_retry_with_backoff(app_id),\n    Err(e) => mark_failed(app_id, e),\n}","preventionTips":["Add exponential backoff and rate limiting when scanning many appids","Cache summaries locally so transient ProtonDB outages degrade gracefully","Monitor ProtonDB service status before bulk scans","Treat Ok(None) (404/pending) as a normal outcome, not an error"],"tags":["http","network","api","rust"],"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"}