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
use thiserror::Error;

use tokio::task::JoinError;

#[derive(Error, Debug)]
pub enum Error {
    #[error("Subject Task error")]
    TaskError {
        #[from]
        source: JoinError,
    },
    #[error("Sender Channel Error")]
    SenderChannelError,
    #[error("Serde JSON error")]
    SerdeJson {
        #[from]
        source: serde_json::Error,
    },

    #[error("MessagePack serialize error")]
    MsgPackSerialize {
        #[from]
        source: rmp_serde::encode::Error,
    },

    #[error("MessagePack deserialize error")]
    MsgPackDeserialize {
        #[from]
        source: rmp_serde::decode::Error,
    },
    #[error("Cant send message. Channel closed")]
    ChannelClosed,
    #[error("Error Creating message")]
    CreatingMessageError,
}