rsiot/components/shared_tasks/cmp_http_client/
error.rs

1use crate::{components::shared_tasks, executor::ComponentError};
2
3#[allow(missing_docs)]
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("TaskInputRequest")]
7    TaskInputRequest,
8
9    #[error("TaskPeriodicRequest")]
10    TaskPeriodicRequest,
11
12    #[error("TaskProcessResponse")]
13    TaskProcessResponse,
14
15    #[error("TokioSyncMpscSend")]
16    TokioSyncMpscSend,
17
18    #[error("TokioJoin")]
19    TokioJoin(#[from] tokio::task::JoinError),
20
21    #[error(transparent)]
22    TaskMsgBusToMpsc(shared_tasks::msgbus_to_mpsc::Error),
23
24    #[error(transparent)]
25    TaskMpscToMsgBus(shared_tasks::mpsc_to_msgbus::Error),
26
27    #[error("End execution of HTTP client: {0}")]
28    TaskEndHttpClient(String),
29}
30
31impl From<Error> for ComponentError {
32    fn from(value: Error) -> Self {
33        ComponentError::Execution(value.to_string())
34    }
35}