{"record":{"id":"203b52e6a14fe7f1","repo":"astral-sh/ruff","slug":"failed-to-send-response-error","errorCode":null,"errorMessage":"Failed to send response: {error}","messagePattern":"Failed to send response: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_server/src/session/client.rs","lineNumber":165,"sourceCode":"            .map_err(|error| anyhow!(\"Failed to send response for request {id}: {error}\"))\n    }\n\n    /// Sends an error response to the client for a given request ID.\n    ///\n    /// The response isn't sent immediately. Instead, it's queued up in the main loop.\n    pub(crate) fn respond_err(\n        &self,\n        id: RequestId,\n        error: lsp_server::ResponseError,\n    ) -> crate::Result<()> {\n        let response = lsp_server::Response {\n            id,\n            response_result: Err(error),\n        };\n\n        self.main_loop_sender\n            .send(Event::SendResponse(response))\n            .map_err(|error| anyhow!(\"Failed to send response: {error}\"))\n    }\n\n    /// Shows a message to the user.\n    ///\n    /// This opens a pop up in VS Code showing `message`.\n    pub(crate) fn show_message(\n        &self,\n        message: impl Display,\n        message_type: lsp_types::MessageType,\n    ) -> crate::Result<()> {\n        self.send_notification::<lsp_types::ShowMessageNotification>(lsp_types::ShowMessageParams {\n            kind: message_type,\n            message: message.to_string(),\n        })\n    }\n\n    /// Sends a request to display a warning to the client with a formatted message. The warning is\n    /// sent in a `window/showMessage` notification.","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ruff_server/src/session/client.rs#L147-L183","documentation":"Error \"Failed to send response: {error}\" thrown in astral-sh/ruff.","triggerScenarios":"Thrown at crates/ruff_server/src/session/client.rs:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}