pub enum MoostacheError {
Show 18 variants
IoError(String, ErrorKind),
ParseErrorGeneric(String),
ParseErrorNoContent(String),
ParseErrorUnclosedSectionTags(String),
ParseErrorInvalidEscapedVariableTag(String),
ParseErrorInvalidUnescapedVariableTag(String),
ParseErrorInvalidSectionEndTag(String),
ParseErrorMismatchedSectionEndTag(String),
ParseErrorInvalidCommentTag(String),
ParseErrorInvalidSectionStartTag(String),
ParseErrorInvalidInvertedSectionStartTag(String),
ParseErrorInvalidPartialTag(String),
LoaderErrorTemplateNotFound(String),
LoaderErrorNonUtf8FilePath(PathBuf),
ConfigErrorNonPositiveCacheSize,
ConfigErrorInvalidTemplatesDirectory(PathBuf),
ConfigErrorTooManyTemplates,
SerializationError,
}Expand description
Enum of all possible errors that moostache can produce.
The String in almost every enum variant
is the name of the template which produced
the error.
Variants§
IoError(String, ErrorKind)
Reading from the filesystem, or writing to a writer, failed for whatever reason.
ParseErrorGeneric(String)
Parsing failed for some generic unidentifiable reason.
ParseErrorNoContent(String)
Parsing failed because the template was empty.
ParseErrorUnclosedSectionTags(String)
Not all sections were properly closed in the template.
ParseErrorInvalidEscapedVariableTag(String)
Some escaped variable tag, e.g. {{ variable }}, was invalid.
ParseErrorInvalidUnescapedVariableTag(String)
Some unescaped variable tag, e.g. {{{ variable }}}, was invalid.
ParseErrorInvalidSectionEndTag(String)
Some section end tag, e.g. {{/ section }}, was invalid.
ParseErrorMismatchedSectionEndTag(String)
Some section end tag doesn’t match its section start tag, e.g. {{# section1 }} … {{/ section2 }}
ParseErrorInvalidCommentTag(String)
Some comment tag, e.g. {{! comment }}, is invalid.
ParseErrorInvalidSectionStartTag(String)
Some section start tag, e.g. {{ section }}, is invalid.
ParseErrorInvalidInvertedSectionStartTag(String)
Some inverted section start tag, e.g. {{^ section }}, is invalid.
ParseErrorInvalidPartialTag(String)
Some partial tag, e.g. {{> partial }}, is invalid.
LoaderErrorTemplateNotFound(String)
Loader tried to load a template but couldn’t find it by its name.
LoaderErrorNonUtf8FilePath(PathBuf)
FileLoader tried to load a template but its filepath wasn’t
valid utf-8.
ConfigErrorNonPositiveCacheSize
Cache size parameter in LoaderConfig must be greater than zero.
ConfigErrorInvalidTemplatesDirectory(PathBuf)
Templates directory passed to LoaderConfig is not a directory.
ConfigErrorTooManyTemplates
Tried creating a HashMapLoader from a LoaderConfig but there were
more templates in the directory than the maximum allowed by cache
size so not all templates could be loaded into memory. To fix this
increase your cache size or switch to FileLoader.
SerializationError
moostache uses serde_json internally, and if serde_json fails
to serialize anything for any reason this error will be returned.
Trait Implementations§
Source§impl Clone for MoostacheError
impl Clone for MoostacheError
Source§fn clone(&self) -> MoostacheError
fn clone(&self) -> MoostacheError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more