astral-sh/ruff · error · anyhow::Error

Failed to send notification (method={method}): {error}

Error message

Failed to send notification (method={method}): {error}

What it means

Error "Failed to send notification (method={method}): {error}" thrown in astral-sh/ruff.

Source

Thrown at crates/ruff_server/src/session/client.rs:106

                format!("Failed to send request method={method}", method = R::METHOD)
            })?;

        Ok(())
    }

    /// Sends a notification to the client.
    pub(crate) fn send_notification<N>(&self, params: N::Params) -> crate::Result<()>
    where
        N: lsp_types::Notification,
    {
        let method = N::METHOD.to_string();

        self.client_sender
            .send(lsp_server::Message::Notification(Notification::new(
                method, params,
            )))
            .map_err(|error| {
                anyhow!(
                    "Failed to send notification (method={method}): {error}",
                    method = N::METHOD
                )
            })
    }

    /// Sends a notification without any parameters to the client.
    ///
    /// This is useful for notifications that don't require any data.
    #[expect(dead_code)]
    fn send_notification_no_params(&self, method: &str) -> crate::Result<()> {
        self.client_sender
            .send(lsp_server::Message::Notification(Notification::new(
                method.to_string(),
                Value::Null,
            )))
            .map_err(|error| anyhow!("Failed to send notification (method={method}): {error}"))
    }

View on GitHub (pinned to 672bb4edf0)

When it happens

Trigger: Thrown at crates/ruff_server/src/session/client.rs:106 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/ruff@672bb4edf0 (2026-08-16). Data as JSON: /api/errors/3d278e56fdc21594. Report an issue: GitHub.