Skip to main content

graphrt_eval/
error.rs

1//! Errors raised while loading or running an evaluation.
2
3/// An evaluation error.
4#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)]
5#[non_exhaustive]
6pub enum EvalError {
7    /// The eval file, a dataset line or an assertion is invalid.
8    #[error("{0}")]
9    Invalid(String),
10    /// A file could not be read or written.
11    #[error("{0}")]
12    Io(String),
13    /// The system under test could not be run at all (not a failed run: those
14    /// are recorded in the test result).
15    #[error("{0}")]
16    Run(String),
17}
18
19impl EvalError {
20    pub(crate) fn invalid(message: impl Into<String>) -> Self {
21        Self::Invalid(message.into())
22    }
23}