From 063fbdcdad36620c1f8759ec1e67d9c553cc3647 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Sat, 8 Feb 2025 21:54:50 -0800 Subject: [PATCH] Improve debug message --- src/sparse.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sparse.rs b/src/sparse.rs index 20a5b9da..b035612e 100644 --- a/src/sparse.rs +++ b/src/sparse.rs @@ -70,7 +70,8 @@ impl SparseIndex { .cache_path(name) .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, "bad name"))?; - let cache_bytes = std::fs::read(cache_path)?; + let cache_bytes = std::fs::read(&cache_path) + .map_err(|e| io::Error::new(e.kind(), format!("{}: `{}`", cache_path.display(), e.to_string())))?; Ok(Crate::from_cache_slice(&cache_bytes, None)?) }