summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-08 08:24:40 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-08 09:37:21 +0300
commitfc917bf829c8a7cbf950754abc7085ffb00dbf17 (patch)
treedebaa476835926b80af97d47d4df6c7a72c2e0c7 /src/error.rs
parent518e7dc2d5f97387702af0a300cc2842bd0deec6 (diff)
downloadjt2-fc917bf829c8a7cbf950754abc7085ffb00dbf17.tar.gz
feat! add support for tera templates for new journal entries
There is a hardcoded default template, plus one can be overridden per journal by adding a .config/templates/new_entry file in the journal.
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 199d1e4..a6f239e 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -61,4 +61,12 @@ pub enum JournalError {
/// Editor failed.
#[error("editor {0} failed: {1}")]
EditorFailed(PathBuf, String),
+
+ /// Template not found.
+ #[error("template not found: {0}")]
+ TemplateNotFound(String),
+
+ /// Failed to render a Tera template.
+ #[error("template {0} failed to render: {1}")]
+ TemplateRender(String, #[source] tera::Error),
}