aboutsummaryrefslogtreecommitdiffstats
path: root/crates/client/src/command
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-23 19:46:52 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-08-23 19:46:52 +0200
commit4b0671b1315c42ba20a7dead033e22277cf243bf (patch)
tree592c090c8d7e5b7c64e55d1d39f721e58d239a9d /crates/client/src/command
parentcrates/client: Rename to turtle-client (diff)
downloadatuin-4b0671b1315c42ba20a7dead033e22277cf243bf.zip
crates/client/daemon/status: Fail, when connection to daemon fails
Diffstat (limited to 'crates/client/src/command')
-rw-r--r--crates/client/src/command/client/daemon.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/client/src/command/client/daemon.rs b/crates/client/src/command/client/daemon.rs
index e9b0ea4c..ccefc14f 100644
--- a/crates/client/src/command/client/daemon.rs
+++ b/crates/client/src/command/client/daemon.rs
@@ -1,5 +1,5 @@
use clap::Subcommand;
-use eyre::Result;
+use eyre::{Result, bail};
use turtle_api::client::{Probe, probe};
@@ -15,7 +15,7 @@ pub(crate) enum Cmd {
impl Cmd {
pub(crate) async fn run(self, settings: &Settings) -> Result<()> {
match self {
- Cmd::Status => status_cmd(&settings).await,
+ Self::Status => status_cmd(settings).await,
}
}
}
@@ -34,9 +34,11 @@ async fn status_cmd(settings: &Settings) -> Result<()> {
Probe::NeedsRestart(reason) => {
println!("Daemon running (needs restart)");
println!(" Reason: {reason}");
+ bail!("Daemon connection failed")
}
Probe::Unreachable(_) => {
println!("Daemon is not running");
+ bail!("Daemon connection failed")
}
}