Skip to main content

ve3_shared/
error.rs

1use cosmwasm_std::{CheckedMultiplyRatioError, OverflowError, StdError};
2use cw_asset::AssetError;
3use thiserror::Error;
4
5#[derive(Error, Debug, PartialEq)]
6pub enum SharedError {
7  #[error("{0}")]
8  Std(#[from] StdError),
9
10  #[error("{0}")]
11  AssetError(#[from] AssetError),
12
13  #[error("{0}")]
14  OverflowError(#[from] OverflowError),
15
16  #[error("{0}")]
17  CheckedMultiplyRatioError(#[from] CheckedMultiplyRatioError),
18
19  #[error("Unauthorized")]
20  Unauthorized {},
21
22  #[error("Unauthorized missing right: ({0}, {1})")]
23  UnauthorizedMissingRight(String, String),
24
25  #[error("Callbacks can only be invoked by the contract itself")]
26  UnauthorizedCallbackOnlyCallableByContract {},
27
28  #[error("Not allowed to send funds with the execution.")]
29  NoFundsAllowed {},
30
31  #[error("Not found: {0}")]
32  NotFound(String),
33
34  #[error("Not supported: {0}")]
35  NotSupported(String),
36
37  #[error("Insufficient balance: {0}")]
38  InsufficientBalance(String),
39
40  #[error("Wrong deposit: {0}")]
41  WrongDeposit(String),
42
43  #[error("Contract_name does not match: prev: {0}, new: {1}")]
44  ContractMismatch(String, String),
45}