{"record":{"id":"403d2d8cda5bb916","repo":"tonhowtf/omniget","slug":"resposta-do-arxiv-sem-entry","errorCode":null,"errorMessage":"resposta do arXiv sem <entry>","messagePattern":"resposta do arXiv sem <entry>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/arxiv.rs","lineNumber":213,"sourceCode":"    pub id: String,\n    pub version: Option<u32>,\n    pub title: String,\n    pub authors: Vec<String>,\n    pub summary: String,\n    pub categories: Vec<String>,\n    pub primary_category: String,\n    pub published: String,\n    pub updated: String,\n    pub doi: Option<String>,\n    pub journal_ref: Option<String>,\n    pub comment: Option<String>,\n    pub abs_url: String,\n    pub pdf_url: String,\n}\n\n/// Lê o Atom da API do arXiv. Sem crate de XML: o formato é fixo.\npub fn parse_atom(xml: &str) -> anyhow::Result<Meta> {\n    let entry = tag(xml, \"entry\").ok_or_else(|| anyhow!(\"resposta do arXiv sem <entry>\"))?;\n    let raw_id = tag(&entry, \"id\").unwrap_or_default();\n    let title = squeeze(&unescape(&tag(&entry, \"title\").unwrap_or_default()));\n    if title.eq_ignore_ascii_case(\"error\") || raw_id.contains(\"api/errors\") {\n        let msg = squeeze(&unescape(&tag(&entry, \"summary\").unwrap_or_default()));\n        return Err(anyhow!(\n            \"arXiv nao reconheceu o identificador: {}\",\n            if msg.is_empty() { \"sem detalhe\" } else { &msg }\n        ));\n    }\n    let short = raw_id\n        .rsplit(\"/abs/\")\n        .next()\n        .unwrap_or(&raw_id)\n        .trim()\n        .to_string();\n    let r = parse_id(&short).unwrap_or(ArxivRef {\n        id: short.clone(),\n        version: None,","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/arxiv.rs#L195-L231","documentation":"parse_atom parses arXiv's fixed-format Atom API response without an XML crate and requires an <entry> element. If tag(xml, \"entry\") returns None — i.e. the response has no entry — this error is thrown. It almost always means the API returned an empty feed or an error page instead of paper metadata.","triggerScenarios":"Calling fetch/parse_atom with an arXiv id whose query yields no results, arXiv API downtime/maintenance, a malformed request URL, or the response being HTML (rate-limit/captcha page) instead of Atom.","commonSituations":"Typos or wrong format in the arXiv identifier passed to the API; querying during arXiv outages (often Sunday maintenance); hitting the API too fast and getting an HTML error page; arXiv retiring an id.","solutions":["Verify the arXiv id with parse_id or on arxiv.org/abs/<id> before calling the API.","Print/log the raw XML when this error occurs to see whether the response is empty, HTML, or an error feed.","Retry with backoff — arXiv has periodic maintenance windows.","Respect arXiv API rate limits (add delay between requests)."],"exampleFix":"// before\nlet entry = tag(xml, \"entry\").ok_or_else(|| anyhow!(\"resposta do arXiv sem <entry>\"))?;\n// after\nlet entry = tag(xml, \"entry\").ok_or_else(|| {\n    anyhow!(\"resposta do arXiv sem <entry> (primeiros 200 chars: {})\", &xml.chars().take(200).collect::<String>())\n})?;","handlingStrategy":"retry","validationCode":"// valide o id antes da chamada\nif parse_id(&input).is_none() { bail!(\"id arXiv invalido: {}\", input); }","typeGuard":null,"tryCatchPattern":"match fetch(opts).await {\n    Err(e) if e.to_string().contains(\"sem <entry>\") => {\n        // provavel indisponibilidade temporaria; tentar com backoff\n        retry_with_backoff(3, || fetch(opts.clone())).await\n    }\n    other => other,\n}","preventionTips":["Validate the identifier with parse_id before hitting the API.","Respect arXiv rate limits and add delays between requests.","Avoid arXiv maintenance windows (often Sunday evening ET) for batch jobs.","Log raw responses on failure to distinguish empty feeds from HTML error pages."],"tags":["xml-parsing","arxiv","empty-response","api"],"backgroundTag":"unexpected-response-shape","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"}