tonhowtf/omniget · error

nao foi possivel consultar releases de

Error message

nao foi possivel consultar releases de {}: HTTP {}

What it means

github::asset() queries the GitHub API releases endpoint (latest or by tag). Any non-success HTTP response from api.github.com aborts with this error including the status. Common causes are a wrong repo slug, 404 (no releases / wrong tag), or 403 rate limiting since unauthenticated API requests are limited to 60/hour.

Solutions

  1. Check the HTTP status in the message: 404 -> fix the repo slug or tag; 403 -> rate limited
  2. Set a GITHUB_TOKEN (via super::client()) to raise the rate limit
  3. List releases to confirm a release exists for the requested tag
Defensive patterns

Strategy: retry

Validate before calling

if !repo.matches('/').count() == 1 {
    return Err(format!("repo invalido: '{}', use 'owner/name'", repo));
}

Try / catch

match github::asset(repo, tag, pick).await {
    Err(e) if e.to_string().contains("HTTP 403") => {
        eprintln!("rate limit do GitHub; configure GITHUB_TOKEN e aguarde");
    }
    Err(e) if e.to_string().contains("HTTP 404") => {
        eprintln!("repo/tag inexistente: verifique '{}' no github.com", repo);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling asset(repo, ...) where the repo slug is misspelled or doesn't exist (404), the tag doesn't exist, or the GitHub token/IP is rate limited (403) or the API is down (5xx).

Common situations: Unauthenticated CI machines hitting the 60 req/h rate limit; typo like 'owner/repo ' with whitespace; repository renamed or made private; requesting /releases/latest on a repo with only draft or prerelease-only tags (404).

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/github.rs:50

    pub url: String,
    pub size: u64,
    pub digest: Option<String>,
}

/// Primeiro asset da release `tag` (ou da última) que `pick` aceitar.
pub async fn asset(
    client: &reqwest::Client,
    repo: &str,
    tag: Option<&str>,
    pick: impl Fn(&str) -> bool,
) -> anyhow::Result<ReleaseAsset> {
    let url = match tag {
        Some(t) => format!("https://api.github.com/repos/{}/releases/tags/{}", repo, t),
        None => format!("https://api.github.com/repos/{}/releases/latest", repo),
    };
    let response = client.get(&url).send().await?;
    if !response.status().is_success() {
        return Err(anyhow!(
            "nao foi possivel consultar releases de {}: HTTP {}",
            repo,
            response.status()
        ));
    }
    let json: serde_json::Value = response.json().await?;
    let tag = json["tag_name"].as_str().unwrap_or("").to_string();
    let assets = json["assets"]
        .as_array()
        .ok_or_else(|| anyhow!("release de {} sem assets", repo))?;
    for a in assets {
        let name = a["name"].as_str().unwrap_or("");
        if pick(name) {
            return Ok(ReleaseAsset {
                tag: tag.clone(),
                name: name.to_string(),
                url: a["browser_download_url"].as_str().unwrap_or("").to_string(),
                size: a["size"].as_u64().unwrap_or(0),

View on GitHub (pinned to 8600b91f42)