tonhowtf/omniget · error

resposta do arXiv sem

Error message

resposta do arXiv sem <entry>

What it means

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.

Solutions

  1. Verify the arXiv id with parse_id or on arxiv.org/abs/<id> before calling the API.
  2. Print/log the raw XML when this error occurs to see whether the response is empty, HTML, or an error feed.
  3. Retry with backoff — arXiv has periodic maintenance windows.
  4. Respect arXiv API rate limits (add delay between requests).

Example fix

// before
let entry = tag(xml, "entry").ok_or_else(|| anyhow!("resposta do arXiv sem <entry>"))?;
// after
let entry = tag(xml, "entry").ok_or_else(|| {
    anyhow!("resposta do arXiv sem <entry> (primeiros 200 chars: {})", &xml.chars().take(200).collect::<String>())
})?;
Defensive patterns

Strategy: retry

Validate before calling

// valide o id antes da chamada
if parse_id(&input).is_none() { bail!("id arXiv invalido: {}", input); }

Try / catch

match fetch(opts).await {
    Err(e) if e.to_string().contains("sem <entry>") => {
        // provavel indisponibilidade temporaria; tentar com backoff
        retry_with_backoff(3, || fetch(opts.clone())).await
    }
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/403d2d8cda5bb916. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/arxiv.rs:213

    pub id: String,
    pub version: Option<u32>,
    pub title: String,
    pub authors: Vec<String>,
    pub summary: String,
    pub categories: Vec<String>,
    pub primary_category: String,
    pub published: String,
    pub updated: String,
    pub doi: Option<String>,
    pub journal_ref: Option<String>,
    pub comment: Option<String>,
    pub abs_url: String,
    pub pdf_url: String,
}

/// Lê o Atom da API do arXiv. Sem crate de XML: o formato é fixo.
pub fn parse_atom(xml: &str) -> anyhow::Result<Meta> {
    let entry = tag(xml, "entry").ok_or_else(|| anyhow!("resposta do arXiv sem <entry>"))?;
    let raw_id = tag(&entry, "id").unwrap_or_default();
    let title = squeeze(&unescape(&tag(&entry, "title").unwrap_or_default()));
    if title.eq_ignore_ascii_case("error") || raw_id.contains("api/errors") {
        let msg = squeeze(&unescape(&tag(&entry, "summary").unwrap_or_default()));
        return Err(anyhow!(
            "arXiv nao reconheceu o identificador: {}",
            if msg.is_empty() { "sem detalhe" } else { &msg }
        ));
    }
    let short = raw_id
        .rsplit("/abs/")
        .next()
        .unwrap_or(&raw_id)
        .trim()
        .to_string();
    let r = parse_id(&short).unwrap_or(ArxivRef {
        id: short.clone(),
        version: None,

View on GitHub (pinned to 8600b91f42)