rsiot/components/cmp_leptos/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// Ошибки компонента cmp_leptos
#[allow(missing_docs)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("{0}")]
    TokioMpscSend(String),

    #[error("Tokio task join error: {0}")]
    TokioTaskJoin(#[from] tokio::task::JoinError),

    #[error(transparent)]
    CmpOutput(crate::executor::ComponentError),

    #[error("Storage: {0}")]
    Storage(#[from] gloo::storage::errors::StorageError),
}

impl From<Error> for crate::executor::ComponentError {
    fn from(value: Error) -> Self {
        crate::executor::ComponentError::Execution(value.to_string())
    }
}