diff --git a/sfsmcctl/src/main.rs b/sfsmcctl/src/main.rs index 105649b..5fa7574 100644 --- a/sfsmcctl/src/main.rs +++ b/sfsmcctl/src/main.rs @@ -177,12 +177,20 @@ async fn main() -> Result<(), Box> { // TODO: // Perform operations - match action { - "start" => object.start().await?, - "stop" => object.stop().await?, - "restart" => object.restart().await?, - "is-running" => info!("Service at path {} is{} running", path, if !object.is_running().await {"n't"} else {""}), + let res = match action { + "start" => object.start().await, + "stop" => object.stop().await, + "restart" => object.restart().await, + "is-running" => { + info!("Service at path {} is{} running", path, if !object.is_running().await {"n't"} else {""}); + Ok(()) + }, _ => unreachable!("unknown action") + }; + + if let Err(err) = res { + error!("{:?}", err); + std::process::exit(1); } Ok(())