diff --git a/crates/arti/src/subcommands/hss.rs b/crates/arti/src/subcommands/hss.rs index 8ba95f930..01affa9f9 100644 --- a/crates/arti/src/subcommands/hss.rs +++ b/crates/arti/src/subcommands/hss.rs @@ -1,5 +1,6 @@ //! The `hss` subcommand. +use anyhow::anyhow; use arti_client::TorClientConfig; use clap::ArgMatches; @@ -23,8 +24,7 @@ pub(crate) fn run( .find(|(n, _)| **n == nickname) .map(|(_, cfg)| cfg.svc_cfg.clone()) else { - println!("Service {nickname} is not configured"); - return Ok(()); + return Err(anyhow!("Service {nickname} is not configured")); }; // TODO: PreferredRuntime was arbitrarily chosen and is entirely unused @@ -43,7 +43,9 @@ pub(crate) fn run( if let Some(onion) = onion_svc.onion_name() { println!("{onion}"); } else { - println!("Service {nickname} does not exist, or does not have an K_hsid yet"); + return Err(anyhow!( + "Service {nickname} does not exist, or does not have an K_hsid yet" + )); } } diff --git a/crates/arti/tests/testcases/hss/hss.md b/crates/arti/tests/testcases/hss/hss.md index da4977896..995f8e447 100644 --- a/crates/arti/tests/testcases/hss/hss.md +++ b/crates/arti/tests/testcases/hss/hss.md @@ -9,6 +9,7 @@ $ arti -c hss.toml hss --nickname acutus-cepa onion-name mnyizjj7m3hpcr7i5afph3zt7maa65johyu2ruis6z7cmnjmaj3h6tad.onion $ arti -c hss.toml hss --nickname flamingo onion-name -Service flamingo is not configured +? 127 +[..]/arti: error: Service flamingo is not configured ```