1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// A wrap `Result` contains custom errors.
pub type Result<T> = std::result::Result<T, Error>;

/// Errors enum mapping global custom errors.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
    #[error("Decode error.")]
    DecodeError,
    #[error("Encode error.")]
    EncodeError,
    #[error("Invalid method.")]
    InvalidMethod,
    #[error("Rpc error: {0}")]
    RpcError(crate::jsonrpc_client::client::RpcError),
    #[error("Invalid signature.")]
    InvalidSignature,
    #[error("Invalid headers.")]
    InvalidHeaders,
}