1use std::fmt::{Debug, Display, Formatter};
3
4#[derive(Debug, Eq, PartialEq, Copy, Clone)]
6#[non_exhaustive]
7pub enum RuntimeError {
8 OutOfTime,
10 DeadlockDetected,
14}
15
16impl Display for RuntimeError {
17 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
18 match self {
19 RuntimeError::OutOfTime => {
20 write!(f, "Ran out of allocated time this tick")
21 }
22 RuntimeError::DeadlockDetected => {
23 write!(f, "Async runtime has been deadlocked")
24 }
25 }
26 }
27}
28
29impl std::error::Error for RuntimeError {}