BigPizzaV3/CodexPlusPlus · error

DreamSkin 服务返回空响应

Error message

DreamSkin 服务返回空响应

What it means

After download_limited finishes streaming the DreamSkin HTTP response, it checks `bytes.is_empty()`. An empty body means the server returned nothing usable (no catalog data, no theme image), so the library bails with "DreamSkin 服务返回空响应" rather than propagating empty bytes to parsers.

Solutions

  1. Check the DreamSkin service status / retry later; an empty 200 usually means server-side trouble
  2. Verify the request URL is the correct community catalog/theme endpoint
  3. Test with curl to confirm whether the raw endpoint also returns an empty body
  4. Rule out local proxies/VPNs stripping the body (try direct connection)
Defensive patterns

Strategy: retry

Validate before calling

// Pre-flight: reject empty bodies before parsing
// let resp = client.get(url).send().await?;
// if resp.content_length() == Some(0) { bail!("upstream returned empty body"); }

Try / catch

let bytes = loop {
    match download_limited(&url, limit).await {
        Ok(b) if b.is_empty() => { /* empty handled inside lib; still guard */ break fallback_bytes()?; }
        Ok(b) => break b,
        Err(e) if is_transient(&e) && retries < 3 => { retries += 1; sleep(BACKOFF).await; }
        Err(e) => return Err(e.into()),
    }
};

Prevention

When it happens

Trigger: fetch_community_catalog or install_community_theme hits an endpoint that returns HTTP success with a zero-length body: e.g. 200/204 with no payload, an empty CDN object, or an interposed proxy swallowing the body.

Common situations: DreamSkin community service outage or maintenance returning empty 200s; CDN edge serving a deleted/empty object; corporate proxy stripping response bodies; wrong endpoint URL that returns an empty page.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/693a4ddfe4d3f40b. Report an issue: GitHub.

Appendix: source

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

        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();
    let mut stream = response.bytes_stream();
    while let Some(chunk) = stream.next().await {
        let chunk = chunk?;
        if bytes.len().saturating_add(chunk.len()) > limit {
            bail!("DreamSkin 响应超过大小限制");
        }
        bytes.extend_from_slice(&chunk);
    }
    if bytes.is_empty() {
        bail!("DreamSkin 服务返回空响应");
    }
    Ok(bytes)
}

#[cfg(test)]
mod tests {
    use super::*;

    fn valid_theme(id: &str) -> DreamSkinCommunityTheme {
        DreamSkinCommunityTheme {
            apply_compatible: true,
            author_display_name: "Theme Author".to_string(),
            author_user_id: String::new(),
            display_meta: serde_json::Value::Null,
            download_count: 0,
            id: id.to_string(),
            license: "MIT".to_string(),
            name: "Theme Name".to_string(),

View on GitHub (pinned to b1ed92e5e4)