#[derive(Debug, Clone, thiserror::Error)]
pub enum ParseError {
#[error("unexpected token at position {position}: expected {expected}, found '{found}'")]
UnexpectedToken {
position: usize,
expected: String,
found: String,
},
#[error("unmatched closing parenthesis at position {position}")]
UnmatchedCloseParen { position: usize },
#[error("empty expression after stripping status prefix")]
EmptyExpression,
#[error("invalid condition reference: '{content}'")]
InvalidConditionRef { content: String },
}
#[derive(Debug, thiserror::Error)]
pub enum ValidationError {
#[error("condition expression parse error: {0}")]
ConditionParse(#[from] ParseError),
#[error("unknown Pruefidentifikator: '{0}'")]
UnknownPruefidentifikator(String),
#[error("no condition evaluator registered for {message_type}/{format_version}")]
NoEvaluator {
message_type: String,
format_version: String,
},
}