Skip to content

Commit 6248319

Browse files
Better error messages for file_data (#99)
1 parent 42a277d commit 6248319

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/file_data.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ impl FileDataSource {
2424
where
2525
T: for<'a> Deserialize<'a>,
2626
{
27-
let f = File::open(path).map_err(|e| e.to_string())?;
27+
let path = path.as_ref();
28+
let f = File::open(path)
29+
.map_err(|e| format!("error opening file '{}': {}", path.display(), e))?;
2830
let f = zstd::Decoder::new(f).map_err(|e| e.to_string())?;
2931
ciborium::from_reader(f).map_err(|e| e.to_string())
3032
}

0 commit comments

Comments
 (0)