1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use thiserror::Error;

/// Collection of errors in the library
#[derive(Debug, Error)]
pub enum SrTemplateError {
    /// This error appears when the syntax of the template to be rendered is wrong.
    #[error("Invalid syntaxis")]
    BadSyntax(String),

    /// This error appears when the variable to be rendered does not exist.
    #[error("Variable not found: {0}")]
    VariableNotFound(String),

    /// This error appears when the function to be rendered does not exist.
    #[error("Function not imlemented: {0}")]
    FunctionNotImplemented(String),

    /// This error appears when the function to be rendered has suffered from an internal error.
    #[error("Error Processing Function: {0}")]
    Function(#[from] super::template::function::FunctionError),
}