Properly fail when helper fails
This commit is contained in:
parent
594ead0f70
commit
6a05aa8083
@ -18,7 +18,7 @@ along with Yama. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
use crate::descriptor::{Descriptor, DestPileDescriptor, SourceDescriptor, VirtualSourceKind};
|
use crate::descriptor::{Descriptor, DestPileDescriptor, SourceDescriptor, VirtualSourceKind};
|
||||||
use crate::labelling::{label_node, load_labelling_rules, str_to_label, Label, State};
|
use crate::labelling::{label_node, load_labelling_rules, str_to_label, Label, State};
|
||||||
use crate::tree::{scan, FileTree, FileTree1};
|
use crate::tree::{scan, FileTree, FileTree1};
|
||||||
use anyhow::anyhow;
|
use anyhow::{anyhow, bail};
|
||||||
use arc_interner::ArcIntern;
|
use arc_interner::ArcIntern;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
@ -226,7 +226,7 @@ pub fn backup_source_to_destination(
|
|||||||
|
|
||||||
let exit_status = process.wait()?;
|
let exit_status = process.wait()?;
|
||||||
if !exit_status.success() {
|
if !exit_status.success() {
|
||||||
error!(
|
bail!(
|
||||||
"The process was not successful (exit code {}). Exiting.",
|
"The process was not successful (exit code {}). Exiting.",
|
||||||
exit_status.code().unwrap()
|
exit_status.code().unwrap()
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user