1 | #[non_exhaustive ] |
2 | #[derive (Debug)] |
3 | pub enum LockstepError { |
4 | ArgumentNotFound(String), |
5 | InterfaceNotFound(String), |
6 | MemberNotFound(String), |
7 | PropertyNotFound(String), |
8 | } |
9 | |
10 | impl std::error::Error for LockstepError {} |
11 | |
12 | impl std::fmt::Display for LockstepError { |
13 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
14 | match self { |
15 | LockstepError::ArgumentNotFound(name: &String) => { |
16 | write!(f, "Argument \"{name}\" not found." ) |
17 | } |
18 | LockstepError::InterfaceNotFound(name: &String) => { |
19 | write!(f, "Interface \"{name}\" not found." ) |
20 | } |
21 | LockstepError::MemberNotFound(name: &String) => { |
22 | write!(f, "Member \"{name}\" not found." ) |
23 | } |
24 | LockstepError::PropertyNotFound(name: &String) => { |
25 | write!(f, "Property \"{name}\" not found." ) |
26 | } |
27 | } |
28 | } |
29 | } |
30 | |