cli: provide error context for ssh-agent connect

Provide more context to the ssh-agent error for easier debugging when `rad auth`.
fails.
This commit is contained in:
Fintan Halpenny 2025-02-21 15:10:25 +00:00
parent ffc86f8a96
commit a723068246
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ use std::ffi::OsString;
use std::ops::Not as _; use std::ops::Not as _;
use std::str::FromStr; use std::str::FromStr;
use anyhow::anyhow; use anyhow::{anyhow, Context};
use radicle::crypto::ssh; use radicle::crypto::ssh;
use radicle::crypto::ssh::Passphrase; use radicle::crypto::ssh::Passphrase;
@ -129,7 +129,7 @@ pub fn init(options: Options) -> anyhow::Result<()> {
Err(e) if e.is_not_running() => { Err(e) if e.is_not_running() => {
agent = false; agent = false;
} }
Err(e) => Err(e)?, Err(e) => Err(e).context("failed to connect to ssh-agent")?,
} }
} }