rsiot/components/cmp_websocket_server/
errors.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use crate::{components::shared_tasks, serde_utils};

#[allow(missing_docs)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("{0}")]
    Tungstenite(#[from] tokio_tungstenite::tungstenite::Error),

    #[error("Error bind to port: {0}")]
    BindToPort(std::io::Error),

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

    #[error("TokioSyncMpsc")]
    TokioSyncMpsc,

    #[error("{0}")]
    FnInput(anyhow::Error),

    #[error("Error: {err}, text from client: {data}")]
    FnOutput { err: anyhow::Error, data: String },

    #[error("Client disconnected")]
    ClientDisconnected,

    #[error(transparent)]
    CmpOutput(crate::executor::ComponentError),

    #[error("TaskEndInput")]
    TaskEndInput,

    #[error("TaskEndOutput")]
    TaskEndOutput,

    #[error(transparent)]
    SharedTaskMsgBusToMpsc(shared_tasks::msgbus_to_mpsc::Error),

    #[error(transparent)]
    SharedTaskMpscToMsgBus(shared_tasks::mpsc_to_msgbus::Error),

    #[error(transparent)]
    Serde(#[from] serde_utils::Error),
}