abstract_manager/
error.rs

1use abstract_sdk::{std::objects::module::ModuleInfo, AbstractSdkError};
2use abstract_std::{
3    objects::{validation::ValidationError, version_control::VersionControlError},
4    AbstractError,
5};
6use cosmwasm_std::{Instantiate2AddressError, StdError};
7use thiserror::Error;
8
9#[derive(Error, Debug, PartialEq)]
10pub enum ManagerError {
11    #[error("{0}")]
12    Std(#[from] StdError),
13
14    #[error("{0}")]
15    Abstract(#[from] AbstractError),
16
17    #[error("{0}")]
18    AbstractSdk(#[from] AbstractSdkError),
19
20    #[error("{0}")]
21    Validation(#[from] ValidationError),
22
23    #[error("{0}")]
24    Ownership(#[from] abstract_std::objects::ownership::GovOwnershipError),
25
26    #[error("{0}")]
27    Instantiate2AddressError(#[from] Instantiate2AddressError),
28
29    #[error("{0}")]
30    VersionControlError(#[from] VersionControlError),
31
32    #[error("Module with id: {0} is already installed")]
33    ModuleAlreadyInstalled(String),
34
35    #[error("Cannot remove module because {0:?} depend(s) on it.")]
36    ModuleHasDependents(Vec<String>),
37
38    #[error("Contract got an unexpected Reply")]
39    UnexpectedReply(),
40
41    #[error("The name of the proposed module can not have length 0.")]
42    InvalidModuleName {},
43
44    #[error("Registering module fails because caller is not module factory")]
45    CallerNotModuleFactory {},
46
47    #[error("A migrate msg is required when when migrating this module")]
48    MsgRequired {},
49
50    #[error("{0} not upgradable")]
51    NotUpgradeable(ModuleInfo),
52
53    #[error("Cannot migrate {} twice", module_id)]
54    DuplicateModuleMigration { module_id: String },
55
56    #[error("Your account is currently suspended")]
57    AccountSuspended {},
58
59    #[error("The provided contract version {0} is lower than the current version {1}")]
60    OlderVersion(String, String),
61
62    #[error("The provided module {0} was not found")]
63    ModuleNotFound(String),
64
65    #[error("The provided module {0} can't be installed on an Abstract account")]
66    ModuleNotInstallable(String),
67
68    #[error("Module {module_id} with version {version} does not fit requirement {comp}, post_migration: {post_migration}")]
69    VersionRequirementNotMet {
70        module_id: String,
71        version: String,
72        comp: String,
73        post_migration: bool,
74    },
75
76    #[error("module {0} is a dependency of {1} and is not installed.")]
77    DependencyNotMet(String, String),
78
79    #[error("The provided module {0} has an invalid module reference.")]
80    InvalidReference(ModuleInfo),
81
82    #[error("Cannot remove proxy")]
83    CannotRemoveProxy {},
84
85    #[error("No updates were included")]
86    NoUpdates {},
87
88    #[error("invalid configuration action, {}", error)]
89    InvalidConfigAction { error: StdError },
90
91    #[error("Must use ProposeOwner to change owner")]
92    MustUseProposeOwner {},
93
94    #[error("The address {0} doesn't have an owner, the manager can't determine admin right")]
95    NoContractOwner(String),
96
97    #[error("
98            Checking the admin recursively failed. 
99            You either have the an error in your sub-account configuration or you are not authorized to make this call.
100    ")]
101    SubAccountAdminVerification,
102
103    #[error("Removing sub account failed")]
104    SubAccountRemovalFailed {},
105
106    #[error("Register of sub account failed")]
107    SubAccountRegisterFailed {},
108
109    #[error("Can't renounce account, with active sub account")]
110    RenounceWithSubAccount {},
111
112    #[error("Can't propose Renounced governance, use update_ownership instead")]
113    ProposeRenounced {},
114
115    #[error("Can't create account with Renounced governance")]
116    InitRenounced {},
117
118    #[error("Reinstalls of same version of app or standalone are not allowed")]
119    ProhibitedReinstall {},
120
121    #[error("Failed to query modules to install: {error}")]
122    QueryModulesFailed { error: VersionControlError },
123}