use core::fmt;
use std::error::Error;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SeriesError {
Overflow {
operation: &'static str,
},
}
impl fmt::Display for SeriesError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Overflow { operation } => {
write!(
formatter,
"series operation overflowed i128 while computing {operation}"
)
},
}
}
}
impl Error for SeriesError {}