open_file_locked: improve error message
This commit is contained in:
parent
176e4af964
commit
28b96b56e1
|
@ -109,8 +109,11 @@ pub fn open_file_locked<P: AsRef<Path>>(path: P, timeout: Duration)
|
||||||
Err(err) => bail!("Unable to open lock {:?} - {}",
|
Err(err) => bail!("Unable to open lock {:?} - {}",
|
||||||
path, err),
|
path, err),
|
||||||
};
|
};
|
||||||
lock_file(&mut file, true, Some(timeout))?;
|
match lock_file(&mut file, true, Some(timeout)) {
|
||||||
Ok(file)
|
Ok(_) => Ok(file),
|
||||||
|
Err(err) => bail!("Unable to aquire lock {:?} - {}",
|
||||||
|
path, err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: We cannot implement an Iterator, because Iterators cannot
|
// Note: We cannot implement an Iterator, because Iterators cannot
|
||||||
|
|
Loading…
Reference in New Issue