use crate::stat_id::StatId;
use thiserror::Error;
#[derive(Debug, Error, Clone, PartialEq)]
pub enum StatError {
#[error("Dependency cycle detected: {0:?}")]
CycleDetected(Vec<StatId>),
#[error("Missing dependency: {0}")]
MissingDependency(StatId),
#[error("Missing source for stat: {0}")]
MissingSource(StatId),
#[error("Invalid transform for stat {0}: {1}")]
InvalidTransform(StatId, String),
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_error_display() {
let err = StatError::MissingSource(StatId::from_str("HP"));
assert!(err.to_string().contains("HP"));
}
}