pub enum Error {
Io {
path: PathBuf,
source: Error,
},
Yaml {
path: PathBuf,
source: Error,
},
Invalid(String),
Provider {
context: String,
message: String,
kind: Option<String>,
},
Validation(Vec<String>),
}Expand description
Everything that can go wrong while loading configuration, parsing skill or test-case definitions, talking to a provider, or running evals.
Variants are grouped so the CLI can map them onto stable exit codes: input
problems (Config, Yaml, Skill, Validation) are the user’s to fix;
Provider problems are environmental.
Variants§
Io
A file the user pointed us at could not be read.
Yaml
A YAML document (config or test case) failed to parse.
Invalid(String)
A test case or config was syntactically valid YAML but semantically
wrong (e.g. a numeric eval with min > max).
Provider
The provider command could not be spawned or did not behave. kind, when
set, classifies the failure (e.g. "auth", "rate_limit",
"model_not_found", "quota") so the CLI can distinguish a broken
environment from a broken skill.
Validation(Vec<String>)
A skill definition failed validation. Carries the human-readable findings so the CLI can print them.
Implementations§
Source§impl Error
impl Error
Sourcepub fn provider(context: impl Into<String>, message: impl Display) -> Self
pub fn provider(context: impl Into<String>, message: impl Display) -> Self
Construct a Error::Provider with no classification.
Sourcepub fn provider_classified(
context: impl Into<String>,
message: impl Display,
kind: impl Into<String>,
) -> Self
pub fn provider_classified( context: impl Into<String>, message: impl Display, kind: impl Into<String>, ) -> Self
Construct a classified Error::Provider (e.g. kind = "auth").
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()