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
use config::ConfigError;
use liserk_shared::message_type::MessageTypeError;

/// Enum representing the possible errors that can be encountered by the client.
#[derive(Debug, thiserror::Error)]
#[error("...")]
pub enum Error {
    /// Represents an I/O error from the Tokio runtime.
    TokioIoError(#[from] tokio::io::Error),

    /// Represents a configuration error.
    ConfigError(#[from] ConfigError),

    /// Represents an error encountered during serialization using CBOR format.
    SerializationError(#[from] serde_cbor::Error),

    /// Represents an error regarding the type of message.
    MessageTypeError(#[from] MessageTypeError),

    /// Represents an encryption error when using AES-GCM-SIV.
    EcryptionError(AesError),
}

#[derive(Debug)]
pub enum AesError {
    Encrypt,
    Decrypt,
}