summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-20 18:16:42 +0300
committerLars Wirzenius <liw@liw.fi>2022-10-21 20:05:54 +0300
commitbc6ceda21f2b616d6bfedd9b5e2136e3b7b47e8d (patch)
tree15329e9300d3a8a74dcf3f498c78559355892a38 /src/bin/subplot.rs
parent18dedca71451dab31f43a0725277308471d32dfe (diff)
downloadsubplot-bc6ceda21f2b616d6bfedd9b5e2136e3b7b47e8d.tar.gz
fix: say for which file lookup of input file mtime fails
Sponsored-by: author
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index 907e616..a85ad62 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -308,7 +308,10 @@ impl Docgen {
}
fn mtime(filename: &Path) -> Result<(u64, u32)> {
- let mtime = fs::metadata(filename)?.modified()?;
+ let mtime = fs::metadata(filename)
+ .map_err(|e| SubplotError::InputFileUnreadable(filename.into(), e))?
+ .modified()
+ .map_err(|e| SubplotError::InputFileMtime(filename.into(), e))?;
let mtime = mtime.duration_since(UNIX_EPOCH)?;
Ok((mtime.as_secs(), mtime.subsec_nanos()))
}