use thiserror::Error;
pub type Result<T> = std::result::Result<T, RagDriftError>;
#[derive(Error, Debug)]
pub enum RagDriftError {
#[error("dimension mismatch: baseline={baseline:?}, current={current:?}")]
DimensionMismatch {
baseline: Vec<usize>,
current: Vec<usize>,
},
#[error("insufficient samples: needed at least {needed}, got {got}")]
InsufficientSamples {
needed: usize,
got: usize,
},
#[error("numerical instability in {step}: {reason}")]
NumericalInstability {
step: String,
reason: String,
},
#[error("invalid configuration: {0}")]
InvalidConfig(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("serde error: {0}")]
Serde(#[from] serde_json::Error),
}