BigPizzaV3/CodexPlusPlus · error

DreamSkin 服务返回 HTTP

Error message

DreamSkin 服务返回 HTTP {}

What it means

download_limited performs HTTP GETs for the DreamSkin community service (catalog and package downloads) and bails if the response status is not a success (2xx). The status code is embedded in the message so the caller can see what the server returned. Any 4xx/5xx or unusual redirect-final status produces this error.

Solutions

  1. Read the HTTP status in the message and act accordingly: 404 → refresh catalog (item gone); 429 → back off and retry later; 5xx → retry with exponential backoff.
  2. Refresh the community catalog and retry with the current theme/version metadata.
  3. Check the service endpoint configuration and your network/proxy setup.
  4. Retry the request after a delay for transient 5xx/429 responses.

Example fix

// before
let theme = install_community_theme(state_dir, &metadata).await?;
// after
match install_community_theme(state_dir, &metadata).await {
    Ok(t) => Ok(t),
    Err(e) if e.to_string().contains("HTTP 429") => { tokio::time::sleep(RETRY_DELAY).await; install_community_theme(state_dir, &metadata).await }
    Err(e) => Err(e),
}
Defensive patterns

Strategy: retry

Validate before calling

// Rust
let resp = reqwest::get(&health_url).await?;
let service_up = resp.status().is_success();

Try / catch

// Rust
match download_limited(&client, &url, ct, limit).await {
    Ok(b) => Ok(b),
    Err(e) if e.to_string().contains("HTTP 5") || e.to_string().contains("HTTP 429") => {
        tokio::time::sleep(backoff).await;
        download_limited(&client, &url, ct, limit).await
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: fetch_community_catalog or install_community_theme hitting an endpoint that responds with 404 (theme/version removed), 403 (blocked/region), 429 (rate limited), or 5xx (server error).

Common situations: Theme or version unpublished between listing and download; server-side outage or maintenance; rate limiting after repeated polls; misconfigured endpoint URL pointing at the wrong host.

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 BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/3d0e4fcd456ab029. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/dream_skin_community.rs:445

        .connect_timeout(Duration::from_secs(8))
        .timeout(timeout)
        .build()?)
}

async fn download_limited(
    client: &reqwest::Client,
    url: &str,
    limit: usize,
    expected_content_type: &str,
) -> anyhow::Result<Vec<u8>> {
    let response = client
        .get(url)
        .header(reqwest::header::ACCEPT, expected_content_type)
        .send()
        .await
        .with_context(|| format!("请求失败:{url}"))?;
    if !response.status().is_success() {
        bail!("DreamSkin 服务返回 HTTP {}", response.status());
    }
    let content_type = response
        .headers()
        .get(reqwest::header::CONTENT_TYPE)
        .and_then(|value| value.to_str().ok())
        .and_then(|value| value.split(';').next())
        .map(str::trim)
        .unwrap_or_default();
    if content_type != expected_content_type {
        bail!("DreamSkin 服务返回了不支持的内容类型:{content_type}");
    }
    if response
        .content_length()
        .is_some_and(|length| length == 0 || length > limit as u64)
    {
        bail!("DreamSkin 响应超过大小限制");
    }
    let mut bytes = Vec::new();

View on GitHub (pinned to b1ed92e5e4)