//! Errors for this crate
use std::num::TryFromIntError;

/// Error
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// Internal database error
    #[error("Unknown: {0}")]
    Internal(String),

    /// Serialization error
    #[error("Serde: {0}")]
    Serde(#[from] serde_json::Error),

    /// Internal error while converting types to integer
    #[error("Internal error: {0}")]
    IntErr(#[from] TryFromIntError),

    /// Transaction error
    #[error("Tx: {0}")]
    Tx(String),
}
