summaryrefslogtreecommitdiff
path: root/src/doc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc.rs')
-rw-r--r--src/doc.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/doc.rs b/src/doc.rs
index e65aff5..37f32d6 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -204,7 +204,8 @@ impl<'a> Document {
) -> Result<Document, SubplotError> {
trace!("Parsing document with pullmark-cmark from {:?}", filename);
let filename = filename.to_path_buf();
- let markdown = std::fs::read_to_string(&filename)?;
+ let markdown = std::fs::read_to_string(&filename)
+ .map_err(|err| SubplotError::ReadFile(filename.clone(), err))?;
let ast = ast::AbstractSyntaxTree::from_str(&markdown)?;
trace!("Parsed document OK");