{"record":{"id":"ed8da17b382564cf","repo":"zed-industries/zed","slug":"cloud-websocket-error-error","errorCode":null,"errorMessage":"Cloud WebSocket error: {error}","messagePattern":"Cloud WebSocket error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cloud_api_client/src/websocket/web.rs","lineNumber":34,"sourceCode":"pub struct Connection {\n    rx: SplitStream<WebSocket>,\n}\n\nimpl Connection {\n    fn new(websocket: WebSocket) -> Self {\n        let (_, rx) = websocket.split();\n        Self { rx }\n    }\n\n    pub fn spawn(self, cx: &App) -> (MessageStream, Task<()>) {\n        let mut rx = self.rx;\n        let (message_tx, message_rx) = unbounded();\n        let task = cx.spawn(async move |_cx| {\n            while let Some(frame) = rx.next().await {\n                let frame = match frame {\n                    Ok(frame) => frame,\n                    Err(error) => {\n                        let error = anyhow!(\"Cloud WebSocket error: {error}\");\n                        if message_tx.unbounded_send(Err(error)).is_err() {\n                            break;\n                        }\n                        continue;\n                    }\n                };\n                if !forward_frame(frame, &message_tx) {\n                    break;\n                }\n            }\n        });\n\n        (message_rx.into_stream().boxed(), task)\n    }\n}\n\nimpl CloudApiClient {\n    pub fn connect(self: &std::sync::Arc<Self>, cx: &App) -> Result<Task<Result<Connection>>> {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/cloud_api_client/src/websocket/web.rs#L16-L52","documentation":"Raised inside the Connection::spawn receive loop when the underlying Cloud WebSocket yields an error frame instead of a message. It means the stream itself failed (connection reset, protocol violation, or TLS error) and the message channel will terminate, signaling clients that the Cloud WebSocket session has ended abnormally.","triggerScenarios":"Thrown at crates/cloud_api_client/src/websocket/web.rs:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity and any proxy/firewall that may interrupt long-lived WebSocket connections","Inspect the wrapped error for a close code or TLS/IO cause to distinguish server-side shutdown from local network failure","Re-establish the connection via CloudApiClient::connect once the underlying cause is resolved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}