small_fsm/error.rs
1use std::fmt::Display;
2use thiserror::Error;
3
4/// FSMError is the error type for the FSM.
5#[derive(Debug, Error, PartialEq, Eq)]
6pub enum FSMError<S: Display> {
7 #[error("no transition with error: {0}")]
8 NoTransitionWithError(S),
9
10 #[error("no transition")]
11 NoTransition,
12
13 #[error("internal error: {0}")]
14 InternalError(S),
15
16 #[error("event {0} does not exist")]
17 UnknownEvent(S),
18
19 #[error("event {0} inappropriate in current state {1}")]
20 InvalidEvent(S, S),
21}