use std::fmt::{Debug, Display, Formatter};
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[non_exhaustive]
pub enum RuntimeError {
OutOfTime,
DeadlockDetected,
}
impl Display for RuntimeError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
RuntimeError::OutOfTime => {
write!(f, "Ran out of allocated time this tick")
}
RuntimeError::DeadlockDetected => {
write!(f, "Async runtime has been deadlocked")
}
}
}
}
impl std::error::Error for RuntimeError {}