rsiot/components/cmp_plc/
error.rs

1use crate::{components::shared_tasks, executor::ComponentError};
2
3/// Ошибки cmp_plc
4#[allow(missing_docs)]
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    /// CmpOutput
8    #[error(transparent)]
9    CmpOutput(ComponentError),
10
11    #[error(transparent)]
12    FilterMsgsWithSameData(#[from] shared_tasks::filter_identical_data::Error),
13
14    #[error("Internal channel error: {0}")]
15    TokioSyncMpsc(String),
16
17    #[error("TokioTaskJoin: {0}")]
18    TokioTaskJoin(#[from] tokio::task::JoinError),
19
20    #[error(transparent)]
21    ToCmpOutput(#[from] shared_tasks::mpsc_to_msgbus::Error),
22}
23
24impl From<Error> for ComponentError {
25    fn from(value: Error) -> Self {
26        ComponentError::Execution(value.to_string())
27    }
28}