summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-12-03 09:55:34 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-12-03 13:20:49 +0000
commit330fbd362211e20816f31efec5433e3fe5896caa (patch)
tree4137d829aac701359609a57c134b829b1519c20f /src/error.rs
parent7015e69a2c8bc2894f89b3b7f85fc2bff653933e (diff)
downloadsubplot-330fbd362211e20816f31efec5433e3fe5896caa.tar.gz
codegen: Make template metadata entry mandatory
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index e76c3e4..cea6ec6 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -93,6 +93,15 @@ pub enum SubplotError {
#[error("document has no title")]
NoTitle,
+ /// Document has no template
+ ///
+ /// The document YAML metadata does not define the template to use
+ /// during code generation.
+ ///
+ /// To fix, add a `template` field.
+ #[error("document has no template")]
+ MissingTemplate,
+
/// Pandoc AST is not JSON
///
/// Subplot acts as a Pandoc filter, and as part of that Pandoc