1use {crate::instruction::InstructionError, thiserror::Error};
4
5#[derive(Debug, Error)]
6pub enum ScoobiesError {
7 #[error("Arithmetic underflowed")]
9 ArithmeticUnderflow,
10
11 #[error("Arithmetic overflowed")]
13 ArithmeticOverflow,
14}
15
16impl From<ScoobiesError> for InstructionError {
17 fn from(error: ScoobiesError) -> Self {
18 match error {
19 ScoobiesError::ArithmeticOverflow => InstructionError::ArithmeticOverflow,
20 ScoobiesError::ArithmeticUnderflow => InstructionError::ArithmeticOverflow,
21 }
22 }
23}