cosmos_client/
error.rs

1use cosmrs::ErrorReport;
2use hex::FromHexError;
3use prost::{DecodeError, EncodeError};
4use std::convert::Infallible;
5use std::io;
6use std::num::ParseIntError;
7use std::str::Utf8Error;
8use thiserror::Error;
9
10#[derive(Error, Debug)]
11pub enum CosmosClient {
12    #[error("Tendermint RPC Error")]
13    TendermintRpcError(#[from] tendermint_rpc::Error),
14    #[error("Decode Error")]
15    ProstDecodeError(#[from] DecodeError),
16    #[error("Decode Error")]
17    ProstEncodeError(#[from] EncodeError),
18    #[error("Json Error")]
19    JsonError(#[from] serde_json::Error),
20    #[error("CosmosRs tendermint Error")]
21    CosmRsTendermintError(#[from] cosmrs::tendermint::Error),
22    #[error("bip32 Error")]
23    Bip32Error(#[from] cosmrs::bip32::Error),
24    #[error("Timestamp Error")]
25    TimestampError(#[from] prost_types::TimestampError),
26    #[error("Utf8 Error")]
27    Utf8Error(#[from] Utf8Error),
28    #[error("Utf8 Error")]
29    IoError(#[from] io::Error),
30    #[error("ErrorReport")]
31    ErrorReport(#[from] ErrorReport),
32    #[error("FromHexError")]
33    FromHexError(#[from] FromHexError),
34    #[error("Infaillible")]
35    Infaillible(#[from] Infallible),
36    #[error("Parse Int Error")]
37    ParseIntError(#[from] ParseIntError),
38
39    #[error("Unknown cosmos-sdk Msg")]
40    UnknownCosmosMsg,
41    #[error("Account does not exist {address:?}")]
42    AccountDoesNotExistOnChain { address: String },
43    #[error("Cannot simulate TX Gas Fee")]
44    CannotSimulateTxGasFee,
45    #[error("No signer attached")]
46    NoSignerAttached,
47    #[error("Rpc errors : {0}")]
48    RpcError(String),
49    #[error("Tx Polling Timeout")]
50    TXPollingTimeout,
51    #[error("No base account for vesting wallet")]
52    NoVestingBaseAccount,
53}