use thiserror::Error;
#[derive(Debug)]
#[derive(Error)]
pub enum DirectiveError {
#[error("Variable '{name}' was not found in the context while being used as '{type_name}'")]
NotFound {
name: String,
type_name: &'static str,
},
#[error("Variable '{name}' has type '{found}' but was expected to have type '{expected}'")]
TypeError {
name: String,
expected: &'static str,
found: String,
},
#[error("Failed to parse '{value}' as a literal of type '{type_name}': {message}")]
ParseError {
value: String,
type_name: &'static str,
message: String,
},
}
#[derive(Debug, Error)]
pub enum TemplateError {
#[error("Unclosed delimiter '{0}'")]
MissingDelimiter(char),
#[error("Failed to parse directive: {0}")]
DirectiveParsing(String),
}