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
//! Error type for the node library.
use thiserror::Error;

/// Errors generated by the node library.
#[derive(Debug, Error)]
pub enum Error {
    /// Error generated by the std::io module.
    #[error(transparent)]
    Io(#[from] std::io::Error),

    /// Error generated converting from a slice.
    #[error(transparent)]
    TryFromSlice(#[from] std::array::TryFromSliceError),

    /// Error generated by the core library.
    #[error(transparent)]
    Sdk(#[from] sos_sdk::Error),

    /// Error generate by the ECDSA library.
    #[error(transparent)]
    Ecdsa(#[from] sos_sdk::k256::ecdsa::Error),

    /// Error generate by the elliptic curve library.
    #[error(transparent)]
    Elliptic(#[from] sos_sdk::k256::elliptic_curve::Error),

    /// Error generated by the JSON library.
    #[error(transparent)]
    Json(#[from] serde_json::Error),

    /// Error generated by the Base58 library.
    #[error(transparent)]
    Base58(#[from] bs58::encode::Error),
}