diff --git a/src/backup/dynamic_index.rs b/src/backup/dynamic_index.rs index 4374d37b..30e4e202 100644 --- a/src/backup/dynamic_index.rs +++ b/src/backup/dynamic_index.rs @@ -61,7 +61,8 @@ impl DynamicIndexReader { pub fn open(path: &Path) -> Result { - let file = std::fs::File::open(&path)?; + let file = std::fs::File::open(&path) + .map_err(|err| format_err!("Unable to open dynamic index {:?} - {}", path, err))?; if let Err(err) = nix::fcntl::flock(file.as_raw_fd(), nix::fcntl::FlockArg::LockSharedNonblock) { bail!("unable to get shared lock on {:?} - {}", path, err); diff --git a/src/backup/fixed_index.rs b/src/backup/fixed_index.rs index 086efd56..a4d6213e 100644 --- a/src/backup/fixed_index.rs +++ b/src/backup/fixed_index.rs @@ -60,7 +60,8 @@ impl FixedIndexReader { let full_path = store.relative_path(path); - let mut file = File::open(&full_path)?; + let mut file = File::open(&full_path) + .map_err(|err| format_err!("Unable to open fixed index {:?} - {}", full_path, err))?; if let Err(err) = nix::fcntl::flock(file.as_raw_fd(), nix::fcntl::FlockArg::LockSharedNonblock) { bail!("unable to get shared lock on {:?} - {}", full_path, err);