automata_windows/
error.rs1#[derive(Debug)]
3pub enum UiError {
4 Internal(String),
6 Platform(String),
8}
9
10impl std::fmt::Display for UiError {
11 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12 match self {
13 Self::Internal(s) | Self::Platform(s) => write!(f, "{s}"),
14 }
15 }
16}
17
18impl std::error::Error for UiError {}
19
20impl From<UiError> for ui_automata::AutomataError {
21 fn from(e: UiError) -> Self {
22 match e {
23 UiError::Internal(s) => ui_automata::AutomataError::Internal(s),
24 UiError::Platform(s) => ui_automata::AutomataError::Platform(s),
25 }
26 }
27}