abstract_client/
error.rs

1//! # Represents Abstract Client Errors
2
3use abstract_interface::AbstractInterfaceError;
4use abstract_std::{
5    objects::{validation::ValidationError, AccountId},
6    AbstractError,
7};
8use thiserror::Error;
9
10#[derive(Error, Debug)]
11/// Error type for the abstract client crate.
12#[allow(missing_docs)] // Error type names should be self-explanatory
13pub enum AbstractClientError {
14    #[error(transparent)]
15    Abstract(#[from] AbstractError),
16
17    #[error(transparent)]
18    Interface(#[from] AbstractInterfaceError),
19
20    #[error(transparent)]
21    CwOrch(#[from] cw_orch::prelude::CwOrchError),
22
23    #[error(transparent)]
24    Semver(#[from] semver::Error),
25
26    #[error(transparent)]
27    ValidationError(#[from] ValidationError),
28
29    #[error("Module not installed")]
30    ModuleNotInstalled {},
31
32    #[error("Can't retrieve Account for unclaimed namespace \"{namespace}\".")]
33    NamespaceNotClaimed { namespace: String },
34
35    #[error("Namespace \"{namespace}\" already claimed by account {account_id}")]
36    NamespaceClaimed {
37        namespace: String,
38        account_id: AccountId,
39    },
40
41    #[error("Account {account} doesn't have an associated namespace")]
42    NoNamespace { account: AccountId },
43
44    #[error("Can't add custom funds when using auto_fund.")]
45    FundsWithAutoFund {},
46
47    #[error("Account creation auto_fund assertion failed with required funds: {0:?}")]
48    AutoFundsAssertFailed(Vec<cosmwasm_std::Coin>),
49
50    #[cfg(feature = "interchain")]
51    #[error("Remote account of {account_id} not found on {chain} in {ibc_client_addr}")]
52    RemoteAccountNotFound {
53        account_id: abstract_std::objects::AccountId,
54        chain: abstract_std::objects::TruncatedChainId,
55        ibc_client_addr: cosmwasm_std::Addr,
56    },
57
58    #[cfg(feature = "interchain")]
59    #[error(transparent)]
60    InterchainError(#[from] cw_orch_interchain::core::InterchainError),
61
62    #[error("Service API only allows claiming service modules")]
63    ExpectedService {},
64}