diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:13:46 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:34:28 +0300 |
commit | 2a452b2d2f4fba6f840e2ea33123002ae58e88b2 (patch) | |
tree | 2d92f01ee2e8bec3bf5bd17b271232a7504a1383 /src/doc.rs | |
parent | 2b7160ebdf950ef872f785336fcfe17e0c4cb347 (diff) | |
download | subplot-2a452b2d2f4fba6f840e2ea33123002ae58e88b2.tar.gz |
refactor: replace generic Pandoc error with specific
Replace SubplotError::PandocError with ::Pandoc, which is only for
executing the Pandoc program. In reality, so was the old variant, but
the new one is more specific, and also embeds the error from executing
Pandoc as a source error.
The error message is still crap, but that will be fixed later by not
using Pandoc for parsing Markdown.
Sponsored-by: author
Diffstat (limited to 'src/doc.rs')
-rw-r--r-- | src/doc.rs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -181,7 +181,7 @@ impl<'a> Document { crate::policy::add_citeproc(&mut pandoc); trace!("Invoking Pandoc to parse document {:?}", filename); - let output = match pandoc.execute()? { + let output = match pandoc.execute().map_err(SubplotError::Pandoc)? { pandoc::PandocOutput::ToBuffer(o) => o, _ => return Err(SubplotError::NotJson), }; |