#[non_exhaustive]pub enum LanguageError {
ParseError {
expr: String,
reason: String,
},
EvalError(String),
UnknownVariable(String),
NotFound(String),
NotSupported {
feature: String,
language: String,
},
EvalFailure {
class: ExpressionErrorClass,
position: Option<ErrorPosition>,
detail: Option<String>,
},
TypeMismatch {
expected: String,
actual: String,
position: Option<ErrorPosition>,
},
ConversionError {
source_type: String,
target: String,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ParseError
EvalError(String)
UnknownVariable(String)
NotFound(String)
NotSupported
EvalFailure
Structured evaluation failure with a typed class and an optional engine-reported position inside the expression source.
detail is optional already-redacted diagnostic text: the emitting
crate MUST strip exchange data before storing it here. The Display
output stays short and carries no value text.
TypeMismatch
A value’s type did not match the type expected by the destination.
expected/actual are TYPE names, never runtime values.
ConversionError
The evaluation result could not be converted to the declared
destination type. source_type/target are type/destination names,
never runtime values (see crate::eval::to_expression_failed for the
trusted-target rewrite).
Implementations§
Source§impl LanguageError
impl LanguageError
Sourcepub fn eval_error(expr: &str, message: impl Display) -> Self
pub fn eval_error(expr: &str, message: impl Display) -> Self
Create an EvalError that includes the expression being evaluated.
This preserves the expression context in the error message for easier debugging.
Sourcepub fn class(&self) -> Option<ExpressionErrorClass>
pub fn class(&self) -> Option<ExpressionErrorClass>
Typed failure classification for structured transport
(see crate::eval::to_expression_failed).
Registry/lifecycle variants (UnknownVariable, NotFound,
NotSupported) are not evaluation classes and yield None.
Sourcepub fn position(&self) -> Option<ErrorPosition>
pub fn position(&self) -> Option<ErrorPosition>
Engine-reported 1-based position inside the expression source, when the variant carries one.
Trait Implementations§
Source§impl Debug for LanguageError
impl Debug for LanguageError
Source§impl Display for LanguageError
impl Display for LanguageError
Source§impl Error for LanguageError
impl Error for LanguageError
1.30.0 · 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
use the Display impl or to_string()