{"record":{"id":"693a4ddfe4d3f40b","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin-693a4d","errorCode":null,"errorMessage":"DreamSkin 服务返回空响应","messagePattern":"DreamSkin 服务返回空响应","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_community.rs","lineNumber":473,"sourceCode":"        bail!(\"DreamSkin 服务返回了不支持的内容类型：{content_type}\");\n    }\n    if response\n        .content_length()\n        .is_some_and(|length| length == 0 || length > limit as u64)\n    {\n        bail!(\"DreamSkin 响应超过大小限制\");\n    }\n    let mut bytes = Vec::new();\n    let mut stream = response.bytes_stream();\n    while let Some(chunk) = stream.next().await {\n        let chunk = chunk?;\n        if bytes.len().saturating_add(chunk.len()) > limit {\n            bail!(\"DreamSkin 响应超过大小限制\");\n        }\n        bytes.extend_from_slice(&chunk);\n    }\n    if bytes.is_empty() {\n        bail!(\"DreamSkin 服务返回空响应\");\n    }\n    Ok(bytes)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn valid_theme(id: &str) -> DreamSkinCommunityTheme {\n        DreamSkinCommunityTheme {\n            apply_compatible: true,\n            author_display_name: \"Theme Author\".to_string(),\n            author_user_id: String::new(),\n            display_meta: serde_json::Value::Null,\n            download_count: 0,\n            id: id.to_string(),\n            license: \"MIT\".to_string(),\n            name: \"Theme Name\".to_string(),","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_community.rs#L455-L491","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the DreamSkin service status / retry later; an empty 200 usually means server-side trouble","Verify the request URL is the correct community catalog/theme endpoint","Test with curl to confirm whether the raw endpoint also returns an empty body","Rule out local proxies/VPNs stripping the body (try direct connection)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-flight: reject empty bodies before parsing\n// let resp = client.get(url).send().await?;\n// if resp.content_length() == Some(0) { bail!(\"upstream returned empty body\"); }","typeGuard":null,"tryCatchPattern":"let bytes = loop {\n    match download_limited(&url, limit).await {\n        Ok(b) if b.is_empty() => { /* empty handled inside lib; still guard */ break fallback_bytes()?; }\n        Ok(b) => break b,\n        Err(e) if is_transient(&e) && retries < 3 => { retries += 1; sleep(BACKOFF).await; }\n        Err(e) => return Err(e.into()),\n    }\n};","preventionTips":["Add retry with backoff around community catalog/theme fetches","Show a 'service unavailable, try later' message rather than a raw error","Verify the endpoint URL against current DreamSkin API docs on failures"],"tags":["network","empty-response","download"],"backgroundTag":"empty-response-body","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}