mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-22 11:10:40 +00:00
Handle error for exists on MMapDirectory (#1988)
`exists` will return false in case of other io errors, like permission denied
This commit is contained in:
@@ -369,7 +369,9 @@ impl Directory for MmapDirectory {
|
||||
|
||||
fn exists(&self, path: &Path) -> Result<bool, OpenReadError> {
|
||||
let full_path = self.resolve_path(path);
|
||||
Ok(full_path.exists())
|
||||
full_path
|
||||
.try_exists()
|
||||
.map_err(|io_err| OpenReadError::wrap_io_error(io_err, path.to_path_buf()))
|
||||
}
|
||||
|
||||
fn open_write(&self, path: &Path) -> Result<WritePtr, OpenWriteError> {
|
||||
|
||||
Reference in New Issue
Block a user