use thiserror::Error;
use vernier_mask::MaskError;
#[derive(Debug, Error)]
pub enum EvalError {
#[error("dimension mismatch: {detail}")]
DimensionMismatch {
detail: String,
},
#[error("invalid annotation: {detail}")]
InvalidAnnotation {
detail: String,
},
#[error("json: {0}")]
Json(#[from] serde_json::Error),
#[error("mask: {0}")]
Mask(#[from] MaskError),
#[error("non-finite value in {context}")]
NonFinite {
context: &'static str,
},
#[error("invalid config: {detail}")]
InvalidConfig {
detail: String,
},
#[error("memory budget exceeded: used {used_bytes} / budget {budget_bytes} bytes")]
OutOfBudget {
used_bytes: usize,
budget_bytes: usize,
breakdown: std::collections::HashMap<&'static str, usize>,
},
#[error("not implemented: {feature}")]
NotImplemented {
feature: &'static str,
},
}