summaryrefslogtreecommitdiff
path: root/src/page.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/page.rs')
-rw-r--r--src/page.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/page.rs b/src/page.rs
index a8d60a5..4a9930c 100644
--- a/src/page.rs
+++ b/src/page.rs
@@ -10,6 +10,12 @@ use log::{info, trace};
use std::path::{Path, PathBuf};
use std::time::SystemTime;
+#[derive(Debug, thiserror::Error)]
+pub enum PageError {
+ #[error("could not read file: {0}")]
+ FileRead(PathBuf, #[source] std::io::Error),
+}
+
pub struct Page {
meta: PageMeta,
unprocessed: UnprocessedPage,
@@ -44,7 +50,7 @@ impl WikitextPage {
info!("input file: {}", name);
let src = name.source_path();
- let data = std::fs::read(src).map_err(|e| SiteError::FileRead(src.into(), e))?;
+ let data = std::fs::read(src).map_err(|e| PageError::FileRead(src.into(), e))?;
let wikitext = String::from_utf8(data).map_err(|e| SiteError::Utf8(src.into(), e))?;
let mtime = get_mtime(src)?;