lib_humus/templating/
loader_error.rs1use lib_humus_configuration::HumusConfigError;
6
7use std::path::PathBuf;
8
9use crate::templating::{HumusFormatIdentifier, manifest::TemplatesManifestProblem};
10
11#[derive(Debug, thiserror::Error)]
13pub enum TemplatingEngineLoaderError {
14 #[error("Error with template extra configuration:\n{0}")]
16 ConfigurationError(#[source] HumusConfigError),
17 #[error("Error with templates manifest file:\n{0}")]
19 TemplatesManifestError(#[source] HumusConfigError),
20 #[error("Problems found in templates manifest:\n{0:?}")]
22 TemplatesManifestProblems(Vec<TemplatesManifestProblem>),
23 #[error("No template directory found at {path:?}.")]
25 TemplateDirectoryNotFound {
26 path: PathBuf,
28 },
29 #[error("Error reading template directory at {path:?}")]
31 TemplateDirectoryIoError {
32 path: PathBuf,
34 #[source]
36 error: std::io::Error,
37 },
38 #[error("Error parsing templates for format {format:?} at {path:?}:\n{tera_error}")]
40 TemplateParseError {
41 path: PathBuf,
43 format: HumusFormatIdentifier,
45 #[source]
47 tera_error: tera::Error,
48 },
49}