{"record":{"id":"f8ac312e34b0c8cd","repo":"jlcodes99/cockpit-tools","slug":"ls","errorCode":null,"errorMessage":"官方 LS 返回错误: {} - {} ({})","messagePattern":"官方 LS 返回错误: (.+?) - (.+?) \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cockpit-core/src/modules/wakeup_gateway.rs","lineNumber":1057,"sourceCode":"        .header(\"x-codeium-csrf-token\", csrf_token)\n        .json(body)\n        .send()\n        .await\n        .map_err(|e| format!(\"官方 LS 请求失败: {} ({})\", e, path))?;\n\n    if !resp.status().is_success() {\n        let status = resp.status();\n        let text = resp.text().await.unwrap_or_default();\n        let preview: String = text.chars().take(512).collect();\n        crate::modules::logger::log_error(&format!(\n            \"[WakeupGateway] 官方 LS 返回错误: status={}, path={}, body_len={}, body={}\",\n            status,\n            path,\n            text.len(),\n            preview\n        ));\n        return Err(format!(\n            \"官方 LS 返回错误: {} - {} ({})\",\n            status, text, path\n        ));\n    }\n\n    resp.json::<Value>()\n        .await\n        .map_err(|e| format!(\"官方 LS 响应解析失败: {} ({})\", e, path))\n}\n\nenum OfficialLsExtensionAction {\n    Close(Vec<u8>),\n    HoldStream {\n        content_type: String,\n        first_message: Vec<u8>,\n        shutdown_notify: Arc<Notify>,\n    },\n}\n","sourceCodeStart":1039,"sourceCodeEnd":1075,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/crates/cockpit-core/src/modules/wakeup_gateway.rs#L1039-L1075","documentation":"HTTP failure mapping in the official Language Server wakeup gateway: a proxied request to the official LS returned a non-2xx status. The response body (truncated to 512 chars) is logged as '[WakeupGateway] 官方 LS 返回错误' and the message '官方 LS 返回错误: {} - {} ({})' carries the status, body preview, and path back to the caller as the mapped error result.","triggerScenarios":"Thrown at crates/cockpit-core/src/modules/wakeup_gateway.rs:1057 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the interpolated status/body to identify the upstream cause (401 auth expiry, 429 rate limit, 5xx)","Re-authenticate the account if the LS reports authorization failures","Retry after backoff for transient 5xx/429 responses"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}