tonhowtf/omniget · error

arXiv nao reconheceu o identificador

Error message

arXiv nao reconheceu o identificador: {}

What it means

When arXiv cannot resolve the requested identifier it still returns an Atom feed whose entry has title "Error" or an id containing "api/errors". parse_atom detects that and fails with this message, embedding the entry's <summary> text (or "sem detalhe" if empty). It means the id/URL submitted to arXiv was not recognized.

Solutions

  1. Read the `msg` in the error — arXiv's summary states exactly what was wrong with the identifier.
  2. Validate/normalize the id with the crate's parse_id before calling the API.
  3. Confirm the paper exists at https://arxiv.org/abs/<id>.
  4. If using a versioned id, try dropping the version suffix (e.g. 1706.03762v5 -> 1706.03762).

Example fix

// before
let r = parse_id(&opts.input).ok_or_else(...)?;
let xml = client.get(&url).text().await?;
// after
let r = parse_id(&opts.input).ok_or_else(...)?;
let xml = client.get(&url).text().await?;
if let Err(e) = parse_atom(&xml) {
    if e.to_string().contains("nao reconheceu o identificador") {
        eprintln!("id {} invalido segundo o arXiv; confira arxiv.org/abs/{}", r.full(), r.full());
    }
    return Err(e);
}
Defensive patterns

Strategy: validation

Validate before calling

// pre-flight: id bem formado
let id = parse_id(&input).ok_or("formato de id arXiv nao reconhecido")?;
// opcional: conferir existencia antes
// GET https://arxiv.org/abs/{id.full()} e checar status 200

Try / catch

match fetch(opts).await {
    Err(e) if e.to_string().contains("nao reconheceu o identificador") => {
        eprintln!("id invalido segundo o arXiv: use arxiv.org/abs/<id> para conferir");
    }
    other => other,
}

Prevention

When it happens

Trigger: Fetching a nonexistent or malformed arXiv id (e.g. missing version, wrong category prefix, old id with wrong format); id passed through parse_id but rejected server-side by the API.

Common situations: User pastes a full arXiv URL fragment incorrectly; typo in the id (e.g. 2101.0000 vs 2101.00001); requesting an id with an invalid version suffix; old pre-2007 ids mistyped.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

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

    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,
    });

    let authors = tags(&entry, "author")
        .iter()
        .filter_map(|a| tag(a, "name"))

View on GitHub (pinned to 8600b91f42)