summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-05-06 09:13:46 +0300
committerLars Wirzenius <liw@liw.fi>2022-05-06 09:34:28 +0300
commit2a452b2d2f4fba6f840e2ea33123002ae58e88b2 (patch)
tree2d92f01ee2e8bec3bf5bd17b271232a7504a1383 /src/error.rs
parent2b7160ebdf950ef872f785336fcfe17e0c4cb347 (diff)
downloadsubplot-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/error.rs')
-rw-r--r--src/error.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/error.rs b/src/error.rs
index f0d76e3..1b95f1c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -283,16 +283,9 @@ pub enum SubplotError {
#[error("Error when writing to {0}")]
WriteFile(PathBuf, #[source] std::io::Error),
- /// Pandoc error
- ///
- /// Subplot got an error from Panoc. This is a generic wrapper for
- /// any kinds of Pandoc errors.
- #[error(transparent)]
- PandocError {
- /// The wrapped error.
- #[from]
- source: pandoc::PandocError,
- },
+ /// Error executing Pandoc.
+ #[error("Pandoc failed")]
+ Pandoc(#[source] pandoc::PandocError),
/// Regular expression error
///