rsiot/components/cmp_plc/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::{components::shared_tasks, executor::ComponentError};

/// Ошибки cmp_plc
#[allow(missing_docs)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// CmpOutput
    #[error(transparent)]
    CmpOutput(ComponentError),

    #[error(transparent)]
    FilterMsgsWithSameData(#[from] shared_tasks::filter_identical_data::Error),

    #[error("Internal channel error: {0}")]
    TokioSyncMpsc(String),

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

    #[error(transparent)]
    ToCmpOutput(#[from] shared_tasks::mpsc_to_msgbus::Error),
}

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