From a998ce691d6962ea75d861b25532f4c042c36f1a Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 18 Jul 2025 11:41:08 +0100 Subject: [PATCH] ssh: provide path on connect error Provide the path that is being used for connecting to the SSH agent, when an I/O error occurs. --- crates/radicle-ssh/src/agent/client.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/radicle-ssh/src/agent/client.rs b/crates/radicle-ssh/src/agent/client.rs index 66a69153..6cc2c8eb 100644 --- a/crates/radicle-ssh/src/agent/client.rs +++ b/crates/radicle-ssh/src/agent/client.rs @@ -40,6 +40,12 @@ pub enum Error { var: String, source: std::env::VarError, }, + #[error("Unable to connect SSH agent using the path '{path}': {source}")] + Connect { + path: String, + #[source] + source: std::io::Error, + }, #[error("I/O error while communicating with SSH agent: {0}")] Io(#[from] std::io::Error), } @@ -80,7 +86,12 @@ impl AgentClient { source: err, }) } - Err(err) => return Err(Error::Io(err)), + Err(err) => { + return Err(Error::Connect { + path: path.display().to_string(), + source: err, + }) + } Ok(stream) => stream, };