summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-14 09:45:41 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-14 09:45:41 +0300
commit9ed32d57ef7e63c4d2d6fa21ca4f07d488e967da (patch)
treeb375cbd4e9b9b42e9348c1eaa95a5eec162a09e3 /src/error.rs
parent08740caf6595d3d69458d8196bd489440d508289 (diff)
downloadsubplot-9ed32d57ef7e63c4d2d6fa21ca4f07d488e967da.tar.gz
refactor: don't use anyhow in the library part of the crate
Add one variant to the SubplotError enum and change src/codegen.rs to return Result<_, SubplotError> instead of anyhow::Result<_>.
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 73cfbb6..eb70e28 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -12,7 +12,7 @@ pub enum SubplotError {
/// Subplot could not find a file named as a functions file.
#[error("functions file could not be found: {0}: {1}")]
- FunctionsFileNotFound(PathBuf, anyhow::Error),
+ FunctionsFileNotFound(PathBuf, std::io::Error),
/// The simple pattern specifies a kind that is unknown.
#[error("simple pattern kind {0} is unknown")]
@@ -204,6 +204,10 @@ pub enum SubplotError {
#[error("Couldn't find name of directory containing template spec: {0}")]
NoTemplateSpecDirectory(PathBuf),
+ /// A code template has an error.
+ #[error("Couldn't load template {0}: {1}")]
+ TemplateError(String, tera::Error),
+
/// Unknown classes in use in document
#[error("Unknown classes found in the document: {0}")]
UnknownClasses(String),