//! Defines the [`ScoobiesError`] type.
use {crate::instruction::InstructionError, thiserror::Error};
#[derive(Debug, Error)]
pub enum ScoobiesError {
/// arithmetic underflowed
#[error("Arithmetic underflowed")]
ArithmeticUnderflow,
/// arithmetic overflowed
#[error("Arithmetic overflowed")]
ArithmeticOverflow,
}
impl From<ScoobiesError> for InstructionError {
fn from(error: ScoobiesError) -> Self {
match error {
ScoobiesError::ArithmeticOverflow => InstructionError::ArithmeticOverflow,
ScoobiesError::ArithmeticUnderflow => InstructionError::ArithmeticOverflow,
}
}
}