]> git.r.bdr.sh - rbdr/blog/blobdiff - src/command/sync_up.rs
Improve the error handling
[rbdr/blog] / src / command / sync_up.rs
index a5d2a4cfc5cb817401c4fcb1eb3ef5ea11c1c162..c44e0b03b375e782ef6aca4dbd664e10f6daa088 100644 (file)
@@ -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>> {