{"record":{"id":"8b6dced9a34c023e","repo":"Morganamilo/paru","slug":"download","errorCode":null,"errorMessage":"{}: {}: {}","messagePattern":"\\{\\}: \\{\\}: \\{\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/download.rs","lineNumber":465,"sourceCode":"    let bases = Bases::from_iter(warnings.pkgs);\n    let c = config.color;\n\n    for base in &bases.bases {\n        let mut url = config\n            .aur_url\n            .join(&format!(\"packages/{}\", base.package_base()))?;\n\n        if config.comments >= 2 {\n            url.set_query(Some(\"PP=250\"));\n        }\n\n        let response = client\n            .get(url.clone())\n            .send()\n            .await\n            .with_context(|| format!(\"{}: {}\", base, url))?;\n        if !response.status().is_success() {\n            bail!(\"{}: {}: {}\", base, url, response.status());\n        }\n\n        let document = scraper::Html::parse_document(&response.text().await?);\n        let titles_selector = scraper::Selector::parse(\"div.comments h4.comment-header\").unwrap();\n        let comments_selector =\n            scraper::Selector::parse(\"div.comments div.article-content\").unwrap();\n\n        let titles = document\n            .select(&titles_selector)\n            .map(|node| node.text().collect::<String>());\n\n        let comments = document\n            .select(&comments_selector)\n            .map(|node| node.text().collect::<String>());\n\n        let iter = titles.zip(comments).collect::<Vec<_>>();\n\n        if config.sort_mode == SortMode::TopDown {","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/download.rs#L447-L483","documentation":"show_comments fetches the AUR package web page and parses its comment section. If the HTTP response status is not a success code, it bails with '{base}: {url}: {status}', surfacing the failing package, the requested URL, and the HTTP status code.","triggerScenarios":"Calling show_comments (e.g. via a comment-viewing CLI flag) where client.get(url).send() returns a response whose status().is_success() is false — 404 for a nonexistent package, 403/rate-limit, 5xx from the AUR servers.","commonSituations":"Viewing comments for a package name that was deleted from the AUR; AUR web outage or maintenance returning 5xx; being rate-limited or blocked (403) by the AUR web frontend; network proxy returning non-200 pages.","solutions":["Verify the package base name exists on the AUR (e.g. browse https://aur.archlinux.org/packages/<name>)","Retry later if the AUR is down or rate-limiting you","Check proxy/VPN settings that could inject error responses","Inspect the status code in the message to decide whether it's 404 (bad name) vs 5xx (server issue)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check the package exists before fetching comments\nlet st = reqwest::Client::new()\n    .head(format!(\"https://aur.archlinux.org/packages/{base}\"))\n    .send().await?.status();\nif !st.is_success() { eprintln!(\"package {base} not available: {st}\"); }","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"404\") => eprintln!(\"package not found on AUR\"),\n    Err(e) => eprintln!(\"comment fetch failed: {e}\"),\n    Ok(_) => {},\n}","preventionTips":["Verify package names against the AUR RPC before scraping","Handle AUR downtime and rate limits with backoff","Check the HTTP status code embedded in the message before retrying blindly"],"tags":["network","http","aur","scraping"],"backgroundTag":"http-error-response","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}