ppaass_codec/
error.rs

1use ppaass_crypto::error::CryptoError;
2use ppaass_protocol::error::ProtocolError;
3use thiserror::Error;
4#[derive(Error, Debug)]
5pub enum CodecError {
6    #[error("Codec error happen because of io: {_0:?}")]
7    StdIo(#[from] std::io::Error),
8    #[error("Codec error happen because of protocol: {_0:?}")]
9    Protocol(#[from] ProtocolError),
10    #[error("Codec error happen because of crypto: {_0:?}")]
11    Crypto(#[from] CryptoError),
12    #[error("Bincode error: {_0:?}")]
13    Bincode(#[from] bincode::Error),
14    #[error("Codec error happen because of reason: {_0}")]
15    Other(String),
16}