pub type Result = std::result::Result; #[derive(Debug)] pub struct Error { message: String, } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", &self.message) } } impl std::error::Error for Error {} impl Error { pub fn new(message: &str) -> Self { Error { message: message.to_string(), } } } impl From for Error { fn from(source: handlebars::TemplateError) -> Self { Self { message: source.to_string(), } } } impl From for Error { fn from(source: handlebars::RenderError) -> Self { Self { message: source.to_string(), } } }