entrenar/monitor/inference/counterfactual/
error.rs1#[derive(Debug, Clone, PartialEq)]
5pub enum CounterfactualError {
6 InsufficientData { expected: usize, actual: usize },
8 VersionMismatch { expected: u8, actual: u8 },
10}
11
12impl std::fmt::Display for CounterfactualError {
13 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14 match self {
15 CounterfactualError::InsufficientData { expected, actual } => {
16 write!(f, "Insufficient data: expected {expected}, got {actual}")
17 }
18 CounterfactualError::VersionMismatch { expected, actual } => {
19 write!(f, "Version mismatch: expected {expected}, got {actual}")
20 }
21 }
22 }
23}
24
25impl std::error::Error for CounterfactualError {}