khive_fold/objective/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum ObjectiveError {
8 #[error("No candidates available")]
10 NoCandidates,
11
12 #[error("No candidate met criteria: {0}")]
14 NoMatch(String),
15
16 #[error("Invalid configuration: {0}")]
18 InvalidConfig(String),
19
20 #[error("Objective not found: {0}")]
22 NotFound(String),
23
24 #[error("Scoring error: {0}")]
26 Scoring(String),
27
28 #[error("Fold error: {0}")]
30 Fold(#[from] crate::FoldError),
31}
32
33pub type ObjectiveResult<T> = Result<T, ObjectiveError>;
35
36#[cfg(test)]
37#[path = "error_tests.rs"]
38mod tests;