aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp
diff options
context:
space:
mode:
authorMichael Davis2024-01-23 18:36:53 +0000
committerBlaž Hrastnik2024-01-24 06:47:49 +0000
commitcb25d13028ec1cdf986a3567ea52562ea654a7b8 (patch)
treea820e7dbceebe37fbfb3897429747ba8bfeb524b /helix-lsp
parent6d724a8f331f4b2a8f1a001e990cf6129dc50b00 (diff)
Improve error handling for `which::which` failures
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
Diffstat (limited to 'helix-lsp')
-rw-r--r--helix-lsp/src/client.rs2
-rw-r--r--helix-lsp/src/lib.rs2
2 files changed, 3 insertions, 1 deletions
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<Notify>)> {
// 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),
}