use thiserror::Error;
#[derive(Debug, Error)]
pub enum TaiError {
#[error("config error: {0}")]
Config(String),
#[error("signer error: {0}")]
Signer(String),
#[error("rpc error: {0}")]
Rpc(String),
#[error("rpc response shape: {0}")]
RpcShape(String),
#[error("invalid address/id: {0}")]
InvalidAddress(String),
#[error("decode error: {0}")]
Decode(String),
#[error("transaction failed: {0}")]
TxFailed(String),
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("serde_json: {0}")]
SerdeJson(#[from] serde_json::Error),
#[error("http: {0}")]
Http(#[from] reqwest::Error),
#[error("bcs: {0}")]
Bcs(#[from] bcs::Error),
#[error("hex: {0}")]
Hex(#[from] hex::FromHexError),
#[error("{0}")]
Other(#[from] anyhow::Error),
}