rsiot/components/cmp_esp_uart_slave/
error.rs

1use crate::{components::shared_tasks, executor::ComponentError};
2
3#[allow(missing_docs)]
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("CmpOutput: {0}")]
7    CmpOutput(ComponentError),
8
9    #[error("FnOutput: {0}")]
10    FnInput(anyhow::Error),
11
12    #[error("FnOutput: {0}")]
13    FnOutput(anyhow::Error),
14
15    #[error("TokioTaskJoin: {0}")]
16    TokioTaskJoin(#[from] tokio::task::JoinError),
17
18    #[error("FnUartComm: {0}")]
19    FnUartComm(anyhow::Error),
20
21    #[error("TaskOutput: {0}")]
22    TaskOutput(String),
23
24    #[error("TaskFilterIdenticalData: {0}")]
25    TaskFilterIdenticalData(shared_tasks::filter_identical_data::Error),
26
27    #[error("TaskMpscToMsgbus: {0}")]
28    TaskMpscToMsgbus(shared_tasks::mpsc_to_msgbus::Error),
29}
30
31impl From<Error> for ComponentError {
32    fn from(value: Error) -> Self {
33        ComponentError::Execution(value.to_string())
34    }
35}