pub struct Error { /* private fields */ }
Expand description
Represents template errors.
If debug mode is enabled a template error contains additional debug
information that can be displayed by formatting an error with the
alternative formatting (format!("{:#}", err)
).
Example
Here is an example of you might want to render errors:
match template.render(ctx) {
Ok(result) => println!("{}", result),
Err(err) => {
eprintln!("Could not render template:");
eprintln!(" {:#}", err);
}
}
Implementations
Creates a new error with kind and detail.
Attaches another error as source to this error.
This is supported on crate feature debug
only.
This is supported on crate feature
debug
only.Returns the template debug information is available.
The debug info snapshot is only embedded into the error if the debug
mode is enabled on the environment
(Environment::set_debug
).