Skip to main content

rsiot/components/cmp_math/
error.rs

1use crate::executor::ComponentError;
2
3use super::COMPONENT_NAME;
4
5#[allow(missing_docs)]
6#[derive(Debug, thiserror::Error)]
7pub enum Error {
8    #[error("CmpOutput: {0}")]
9    CmpOutput(ComponentError),
10
11    #[error("TokioTaskJoin: {0}")]
12    TokioTaskJoin(#[from] tokio::task::JoinError),
13
14    #[error("FnProcessEnd")]
15    FnProcessEnd,
16
17    #[error("{COMPONENT_NAME} | SendToMsgbus")]
18    SendToMsgbus,
19
20    #[error("TaskInputEnd")]
21    TaskInputEnd,
22
23    #[error("TaskOutputEnd")]
24    TaskOutputEnd,
25
26    #[error("AlgTaskUnexpectedEnd: {0}")]
27    AlgTaskUnexpectedEnd(String),
28}
29
30impl From<Error> for ComponentError {
31    fn from(value: Error) -> Self {
32        ComponentError::Execution(value.to_string())
33    }
34}