#[non_exhaustive]pub enum EvalError {
Io {
path: Option<PathBuf>,
source: Error,
},
RonParse {
path: PathBuf,
source: SpannedError,
},
Regex {
pattern: String,
source: Error,
},
Agent(String),
}Expand description
The error type for eval-core’s public API.
#[non_exhaustive] so new fallible paths can add variants without a breaking change. Construct the
host-facing variant via EvalError::agent; the I/O / parse / regex variants are produced by ?
through the From impls below.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
An I/O error reading a case directory or file. Carries the offending path (when known) for a fail-loud message that names what couldn’t be read.
Fields
RonParse
A .ron case file failed to parse. Carries the offending file path so a typo fails loud.
Fields
source: SpannedErrorThe underlying RON deserialization error (with span info).
Regex
A regex in a FinalTextMatches expectation
failed to compile.
Fields
Agent(String)
The host’s Agent::run (or another host-supplied step) failed. Carries the
host’s own error rendered to a string — eval-core stays free of the host’s error types.
Implementations§
Source§impl EvalError
impl EvalError
Sourcepub fn agent(error: impl Display) -> Self
pub fn agent(error: impl Display) -> Self
Wrap a host-side run failure (anything Display) as an EvalError::Agent. The canonical way a
host’s Agent::run reports a backend/loop failure to the generic runner.
Trait Implementations§
Source§impl Error for EvalError
impl Error for EvalError
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()
Source§impl From<SpannedError> for EvalError
impl From<SpannedError> for EvalError
Source§fn from(source: SpannedError) -> Self
fn from(source: SpannedError) -> Self
A bare ron error with no associated path. load_cases builds the
path-carrying EvalError::RonParse directly, so this is the fallback for any other call site.