tonhowtf/omniget · error

download de falhou: HTTP

Error message

download de {} falhou: HTTP {}

What it means

`download_verified` fetches the release asset's browser_download URL and requires an HTTP success status. Any non-2xx (404 stale URL, 403 rate limit, 5xx) aborts with this error naming the asset and status. Nothing is written to disk before this check.

Solutions

  1. Re-fetch the latest release via `latest_asset` to get a fresh asset URL, then retry
  2. Check the HTTP status: 403/429 = rate limit — wait or use a token; 404 = URL stale
  3. Test the URL manually with curl to confirm it's a network/CDN issue
  4. Add retry with exponential backoff for transient 5xx/network errors

Example fix

// before
let bytes = download_verified(&client, &asset).await?;
// after
let bytes = loop {
    match download_verified(&client, &asset).await {
        Ok(b) => break b,
        Err(e) if attempts < 3 => { attempts += 1; sleep(Duration::from_secs(2u64.pow(attempts))).await; }
        Err(e) => return Err(e),
    }
};
Defensive patterns

Strategy: retry

Validate before calling

let head = client.get(&asset.url).send().await?;
if !head.status().is_success() { eprintln!("asset URL unhealthy: {}", head.status()); }

Try / catch

let mut delay = Duration::from_secs(1);
loop {
    match download_verified(&client, &asset).await {
        Ok(b) => break Ok(b),
        Err(e) if e.to_string().contains("download") && retries < 3 => {
            retries += 1; sleep(delay).await; delay *= 2;
        }
        Err(e) => break Err(e),
    }
}

Prevention

When it happens

Trigger: `download_verified(client, asset)` where GET on `asset.url` fails: asset removed after release edit, expired/redirected CDN URL, rate-limited download, transient GitHub/CDN outage.

Common situations: Using a cached asset URL from an old release; downloading during a GitHub incident; network proxies blocking github.com/object storage; flaky mobile/corporate networks.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/spicetify.rs:422

                    .as_str()
                    .and_then(integrity::parse_github_digest),
            });
        }
    }
    Err(anyhow!(
        "release {} de {} nao tem um asset para este sistema",
        tag,
        repo
    ))
}

async fn download_verified(
    client: &reqwest::Client,
    asset: &ReleaseAsset,
) -> anyhow::Result<Vec<u8>> {
    let response = client.get(&asset.url).send().await?;
    if !response.status().is_success() {
        return Err(anyhow!(
            "download de {} falhou: HTTP {}",
            asset.name,
            response.status()
        ));
    }
    let bytes = response.bytes().await?.to_vec();
    // O GitHub publica o digest de todo asset; sem ele algo está errado na
    // resposta, e o binário vai ser executado. Fail-closed.
    let expected = asset.digest.as_deref().ok_or_else(|| {
        anyhow!(
            "{} veio sem digest da API do GitHub; download descartado",
            asset.name
        )
    })?;
    integrity::verify_sha256(&bytes, expected, &asset.name)?;
    Ok(bytes)
}

View on GitHub (pinned to 8600b91f42)