{"record":{"id":"2129a8ce68b7c57e","repo":"zed-industries/zed","slug":"x11-connection-unknown-error","errorCode":null,"errorMessage":"X11 connection: Unknown error","messagePattern":"X11 connection: Unknown error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/x11/window.rs","lineNumber":433,"sourceCode":"    }\n\n    if !urgent && !hints.urgent {\n        return;\n    }\n\n    hints.urgent = urgent;\n    check_reply(\n        || \"X11 ChangeProperty for WM_HINTS urgency failed.\",\n        hints.set(xcb, x_window),\n    )\n    .log_err();\n    xcb_flush(xcb);\n}\n\n/// Convert X11 connection errors to `anyhow::Error` and panic for unrecoverable errors.\npub(crate) fn handle_connection_error(err: ConnectionError) -> anyhow::Error {\n    match err {\n        ConnectionError::UnknownError => anyhow!(\"X11 connection: Unknown error\"),\n        ConnectionError::UnsupportedExtension => anyhow!(\"X11 connection: Unsupported extension\"),\n        ConnectionError::MaximumRequestLengthExceeded => {\n            anyhow!(\"X11 connection: Maximum request length exceeded\")\n        }\n        ConnectionError::FdPassingFailed => {\n            panic!(\"X11 connection: File descriptor passing failed\")\n        }\n        ConnectionError::ParseError(parse_error) => {\n            anyhow!(parse_error).context(\"Parse error in X11 response\")\n        }\n        ConnectionError::InsufficientMemory => panic!(\"X11 connection: Insufficient memory\"),\n        ConnectionError::IoError(err) => anyhow!(err).context(\"X11 connection: IOError\"),\n        _ => anyhow!(err),\n    }\n}\n\nimpl X11WindowState {\n    pub fn new(","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/x11/window.rs#L415-L451","documentation":"Mapping arm in handle_connection_error: the X11 server or connection produced a ConnectionError the xrb library does not classify (UnknownError). It is converted to an anyhow::Error for the caller; the doc comment notes unrecoverable connection errors panic elsewhere. Typically the connection was killed mid-request.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/x11/window.rs:428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the underlying X11 error detail and reconnect/reopen windows when the connection dies","Check for X server crash, SSH tunnel drop, or fd exhaustion as common causes of unknown connection errors","Route the returned error up so the app can show a disconnection message instead of continuing on a dead connection"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}