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
//! Error variants for Registry

use std::num::TryFromIntError;

use ethers::{
    contract::ContractError,
    providers::{Middleware, ProviderError},
};
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ContactOperationError<M: Middleware> {
    #[error("Invalid address {0}")]
    BadAddress(#[from] rustc_hex::FromHexError),
    #[error(transparent)]
    ContractError(#[from] ContractError<M>),
    #[error(transparent)]
    ProviderError(#[from] ProviderError),
    #[error("Error converting from int: {0}")]
    IntConversion(#[from] TryFromIntError),
    #[error("Error Resolving {1}: {0}")]
    ResolutionError(lib_didethresolver::error::ResolverError<M>, String),
    #[error("The DID has been deactivated, and no longer valid")]
    DIDDeactivated,
    #[error("Type failed to convert")]
    Type(#[from] lib_didethresolver::error::TypeError),
    #[error("Error parsing hex bytes: {0}")]
    Bytes(#[from] ethers::types::ParseBytesError),
}