Skip to content

Commit

Permalink
Impl Error::source for EvaluationError
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps committed Nov 26, 2024
1 parent 839645f commit 1fa70c9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion limitador/src/limit/cel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ pub(super) mod errors {
}
}

impl Error for EvaluationError {}
impl Error for EvaluationError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
match self {
EvaluationError::UnexpectedValueType(_) => None,
EvaluationError::ExecutionError(err) => Some(err),
}
}
}

#[derive(Debug)]
pub struct ParseError {
Expand Down

0 comments on commit 1fa70c9

Please sign in to comment.