From a723068246bf5ab646efd25f5b9e0f0d6304291a Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 21 Feb 2025 15:10:25 +0000 Subject: [PATCH] cli: provide error context for ssh-agent connect Provide more context to the ssh-agent error for easier debugging when `rad auth`. fails. --- radicle-cli/src/commands/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicle-cli/src/commands/auth.rs b/radicle-cli/src/commands/auth.rs index fe13ac88..d8d449f4 100644 --- a/radicle-cli/src/commands/auth.rs +++ b/radicle-cli/src/commands/auth.rs @@ -3,7 +3,7 @@ use std::ffi::OsString; use std::ops::Not as _; use std::str::FromStr; -use anyhow::anyhow; +use anyhow::{anyhow, Context}; use radicle::crypto::ssh; use radicle::crypto::ssh::Passphrase; @@ -129,7 +129,7 @@ pub fn init(options: Options) -> anyhow::Result<()> { Err(e) if e.is_not_running() => { agent = false; } - Err(e) => Err(e)?, + Err(e) => Err(e).context("failed to connect to ssh-agent")?, } }