From cb25d13028ec1cdf986a3567ea52562ea654a7b8 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 23 Jan 2024 13:36:53 -0500 Subject: Improve error handling for `which::which` failures Co-authored-by: Pascal Kuthe --- helix-lsp/src/client.rs | 2 +- helix-lsp/src/lib.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'helix-lsp') diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index f8c2912e..fb32f6eb 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -183,7 +183,7 @@ impl Client { doc_path: Option<&std::path::PathBuf>, ) -> Result<(Self, UnboundedReceiver<(usize, Call)>, Arc)> { // Resolve path to the binary - let cmd = helix_stdx::env::which(cmd).map_err(|err| anyhow::anyhow!(err))?; + let cmd = helix_stdx::env::which(cmd)?; let process = Command::new(cmd) .envs(server_environment) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index c99ec217..53b2712d 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -44,6 +44,8 @@ pub enum Error { #[error("Unhandled")] Unhandled, #[error(transparent)] + ExecutableNotFound(#[from] helix_stdx::env::ExecutableNotFoundError), + #[error(transparent)] Other(#[from] anyhow::Error), } -- cgit v1.2.3-70-g09d2