diff options
Diffstat (limited to 'src/doc.rs')
-rw-r--r-- | src/doc.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -146,7 +146,7 @@ impl<'a> Document { P: AsRef<Path> + Debug, { trace!("Parsing document..."); - let ast: Pandoc = serde_json::from_str(json)?; + let ast: Pandoc = serde_json::from_str(json).map_err(SubplotError::AstJson)?; Self::from_ast(basedir, markdowns, ast, style, template) } @@ -217,7 +217,7 @@ impl<'a> Document { /// This is useful in a Pandoc filter, so that the filter can give /// it back to Pandoc for typesetting. pub fn ast(&self) -> Result<String, SubplotError> { - let json = serde_json::to_string(&self.ast)?; + let json = serde_json::to_string(&self.ast).map_err(SubplotError::AstJson)?; Ok(json) } |