pub enum TemplateError {
VariableNotFound {
variable: String,
available_variables: Box<Vec<String>>,
suggestions: Box<Vec<String>>,
location: Box<ErrorLocation>,
},
CircularDependency {
chain: Box<Vec<DependencyChainEntry>>,
},
SyntaxError {
message: String,
location: Box<ErrorLocation>,
},
DependencyRenderFailed {
dependency: String,
source: Box<dyn Error + Send + Sync>,
location: Box<ErrorLocation>,
},
ContentFilterError {
depth: usize,
source: Box<dyn Error + Send + Sync>,
location: Box<ErrorLocation>,
},
}Expand description
Enhanced template errors with detailed context
Variants§
VariableNotFound
Variable referenced in template was not found in context
Fields
available_variables: Box<Vec<String>>Complete list of variables available in the current template context
suggestions: Box<Vec<String>>Suggested similar variable names based on Levenshtein distance analysis
location: Box<ErrorLocation>Location information including resource, file path, and dependency chain
CircularDependency
Circular dependency detected in template rendering
Fields
chain: Box<Vec<DependencyChainEntry>>Complete dependency chain showing the circular reference path
SyntaxError
Template syntax parsing or validation error
Fields
location: Box<ErrorLocation>Location information including resource, file path, and dependency chain
DependencyRenderFailed
Failed to render a dependency template
Fields
location: Box<ErrorLocation>Location information including resource, file path, and dependency chain
ContentFilterError
Error occurred during content filter processing
Implementations§
Source§impl TemplateError
impl TemplateError
Sourcepub fn format_with_context(&self) -> String
pub fn format_with_context(&self) -> String
Generate user-friendly error message with context and suggestions
Trait Implementations§
Source§impl Debug for TemplateError
impl Debug for TemplateError
Source§impl Display for TemplateError
impl Display for TemplateError
Source§impl Error for TemplateError
impl Error for TemplateError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for TemplateError
impl !RefUnwindSafe for TemplateError
impl Send for TemplateError
impl Sync for TemplateError
impl Unpin for TemplateError
impl !UnwindSafe for TemplateError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.