From 6a05aa8083e0ef3d0a8e45c94744c1d5a1dcd858 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Mon, 13 Sep 2021 19:52:55 +0100 Subject: [PATCH] Properly fail when helper fails --- datman/src/commands/backup.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datman/src/commands/backup.rs b/datman/src/commands/backup.rs index 0e6986e..73504d8 100644 --- a/datman/src/commands/backup.rs +++ b/datman/src/commands/backup.rs @@ -18,7 +18,7 @@ along with Yama. If not, see . use crate::descriptor::{Descriptor, DestPileDescriptor, SourceDescriptor, VirtualSourceKind}; use crate::labelling::{label_node, load_labelling_rules, str_to_label, Label, State}; use crate::tree::{scan, FileTree, FileTree1}; -use anyhow::anyhow; +use anyhow::{anyhow, bail}; use arc_interner::ArcIntern; use chrono::{DateTime, Utc}; use log::{error, info, warn}; @@ -226,7 +226,7 @@ pub fn backup_source_to_destination( let exit_status = process.wait()?; if !exit_status.success() { - error!( + bail!( "The process was not successful (exit code {}). Exiting.", exit_status.code().unwrap() );