From 8a1d68c8b9b376d7586d31f00f10c6d6d40dd5c2 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 23 Jan 2020 09:58:14 +0100 Subject: [PATCH] src/backup/datastore.rs: improve error messages --- src/backup/datastore.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs index 639e0caf..77ca0bc4 100644 --- a/src/backup/datastore.rs +++ b/src/backup/datastore.rs @@ -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(()) }