aboutsummaryrefslogtreecommitdiff
path: root/src/command/sync_up.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2024-03-09 15:34:57 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2024-03-09 15:34:57 +0100
commit50f53dc480fda8b3daab7a34454c2dd9f3f5f991 (patch)
tree2205be7a9c806ce59c851de9b50b9e18f973008d /src/command/sync_up.rs
parent172f4c8807d44ebe38c7f227b7fdc2d6a9dbe323 (diff)
Improve the error handlingrust
Diffstat (limited to 'src/command/sync_up.rs')
-rw-r--r--src/command/sync_up.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/command/sync_up.rs b/src/command/sync_up.rs
index a5d2a4c..c44e0b0 100644
--- a/src/command/sync_up.rs
+++ b/src/command/sync_up.rs
@@ -15,8 +15,16 @@ impl super::Command for SyncUp {
vec![]
}
- fn execute(&self, _: Option<&String>, configuration: &Configuration, _: &String) -> Result<()> {
- sync_up(&configuration.data_directory, &configuration.remote_config)
+ fn execute(&self, _: Option<&String>, configuration: &Configuration, command: &String) -> Result<()> {
+ match sync_up(&configuration.data_directory, &configuration.remote_config) {
+ Ok(_) => {}
+ Err(e) => {
+ if command == self.command() {
+ return Err(e)
+ }
+ }
+ }
+ return Ok(())
}
fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {