summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-10-19 19:30:37 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-11-19 20:18:50 +0000
commit5a92266170ae9879b0651e6074e538a4de0a214c (patch)
treed5ecb647701534d6374f441f2c790bfdd2dca848 /src/error.rs
parent572d3097770cd8e5cd22d7767c1d18e0d50b9a90 (diff)
downloadsubplot-5a92266170ae9879b0651e6074e538a4de0a214c.tar.gz
various: Rework document to support multiple implementations
In order to eventually shift the document metadata to support more than one template defined for the document this reworks all the internal APIs to expect templates, and also the external CLI to be able to provide it. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index c041eaf..ec88733 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -112,10 +112,19 @@ pub enum SubplotError {
/// The document YAML metadata does not define the template to use
/// during code generation.
///
- /// To fix, add a `template` field.
+ /// To fix, ensure an appropriate `impl` entry is present.
#[error("document has no template")]
MissingTemplate,
+ /// Document has more than one template
+ ///
+ /// The document YAML metadata specifies more than one possible
+ /// template implementation to be used during code generation.
+ ///
+ /// To fix, specify `--template` on the codegen CLI.
+ #[error("document has more than one template possibility")]
+ AmbiguousTemplate,
+
/// Pandoc AST is not JSON
///
/// Subplot acts as a Pandoc filter, and as part of that Pandoc