From d010c9d61aeac08be0964acd1d61fb7d11af3cdd Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Wed, 11 Sep 2024 12:14:27 +0200 Subject: [PATCH] Raise error if dora-coordinator is not connected when calling `dora destroy` --- binaries/cli/src/up.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/cli/src/up.rs b/binaries/cli/src/up.rs index 411bedabf..e96705bb3 100644 --- a/binaries/cli/src/up.rs +++ b/binaries/cli/src/up.rs @@ -1,7 +1,7 @@ use crate::{check::daemon_running, connect_to_coordinator, LOCALHOST}; use dora_core::topics::DORA_COORDINATOR_PORT_CONTROL_DEFAULT; use dora_message::cli_to_coordinator::ControlRequest; -use eyre::Context; +use eyre::{bail, Context}; use std::{fs, net::SocketAddr, path::Path, process::Command, time::Duration}; #[derive(Debug, Default, serde::Serialize, serde::Deserialize)] struct UpConfig {} @@ -61,7 +61,7 @@ pub(crate) fn destroy( println!("Send destroy command to dora-coordinator"); } Err(_) => { - eprintln!("Could not connect to dora-coordinator"); + bail!("Could not connect to dora-coordinator"); } }