#[non_exhaustive]pub enum ErrorKind {
Show 14 variants
Msg(String),
SyntaxError(Box<ReportError>),
RenderingError(Box<ReportError>),
CircularExtend {
tpl: String,
inheritance_chain: Vec<String>,
},
CircularInclude {
tpl: String,
include_chain: Vec<String>,
},
MissingParent {
current: String,
parent: String,
},
NamespaceNotLoaded {
tpl: String,
namespace: String,
},
MacroNotFound {
tpl: String,
namespace: String,
name: String,
},
TemplateNotFound(String),
ComponentNotFound(String),
InvalidArgument {
expected_type: String,
actual_type: String,
},
MissingArgument {
arg_name: String,
},
Io(ErrorKind),
Utf8Conversion,
}Expand description
All the kind of errors Tera can produce. Non-exhaustive so we can add more if needed without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Msg(String)
Generic error
SyntaxError(Box<ReportError>)
Both lexer and parser errors. Will point to the source file
RenderingError(Box<ReportError>)
An error that happens while rendering a template. Will point to the source file
CircularExtend
A loop was found while looking up the inheritance chain
Fields
CircularInclude
A loop was found while following {% include %} calls between templates
Fields
MissingParent
A template is extending a template that wasn’t found in the Tera instance
NamespaceNotLoaded
A template is calling a macro namespace that is not loaded
Fields
MacroNotFound
The template is calling a macro which isn’t found in the namespace
Fields
TemplateNotFound(String)
A template was missing
ComponentNotFound(String)
A component was missing Only raised if you’re trying to render a specific component
InvalidArgument
A filter/test main value was not the expected type
MissingArgument
A function/test/filter was expecting an argument but it wasn’t found
Io(ErrorKind)
An IO error occurred
Utf8Conversion
UTF-8 conversion error when converting output to UTF-8
This should not occur unless invalid UTF8 chars are rendered