diff --git a/rs/cli/src/main.rs b/rs/cli/src/main.rs index ed0901104..d9de25015 100644 --- a/rs/cli/src/main.rs +++ b/rs/cli/src/main.rs @@ -36,7 +36,16 @@ async fn main() -> Result<(), anyhow::Error> { let mut cli_opts = cli::Opts::parse(); let mut cmd = cli::Opts::command(); - let governance_canister_v = governance_canister_version(cli_opts.network.get_url()).await?; + let governance_canister_v = match governance_canister_version(cli_opts.network.get_url()).await { + Ok(c) => c, + Err(e) => { + return Err(anyhow::anyhow!( + "While determining the governance canister version: {}", + e + )) + } + }; + let governance_canister_version = governance_canister_v.stringified_hash; let target_network = cli_opts.network.clone(); @@ -52,9 +61,10 @@ async fn main() -> Result<(), anyhow::Error> { .expect("failed") }); }); + let srv = rx.recv().unwrap(); - ic_admin::with_ic_admin(governance_canister_version.into(), async { + let r = ic_admin::with_ic_admin(governance_canister_version.into(), async { // Start of actually doing stuff with commands. if cli_opts.network == Network::Staging { @@ -299,11 +309,11 @@ async fn main() -> Result<(), anyhow::Error> { } } }) - .await?; + .await; srv.stop(false).await; - Ok(()) + r } // Construct MinNakamotoCoefficients from an array (slice) of ["key=value"], and