src/backup/datastore.rs: improve error messages

This commit is contained in:
Dietmar Maurer 2020-01-23 09:58:14 +01:00
parent 18cc66ee85
commit 8a1d68c8b9

View File

@ -191,6 +191,13 @@ impl DataStore {
log::info!("removing backup group {:?}", full_path);
std::fs::remove_dir_all(full_path)?;
.map_err(|err| {
format_err!(
"removing backup group {:?} failed - {}",
full_path,
err,
)
})?;
Ok(())
}
@ -200,8 +207,15 @@ impl DataStore {
let full_path = self.snapshot_path(backup_dir);
log::info!("removing backup {:?}", full_path);
std::fs::remove_dir_all(full_path)?;
log::info!("removing backup snapshot {:?}", full_path);
std::fs::remove_dir_all(full_path)
.map_err(|err| {
format_err!(
"removing backup snapshot {:?} failed - {}",
full_path,
err,
)
})?;
Ok(())
}