meteora_vault_sdk/errors/
vault.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum VaultError {
13 #[error("Vault is disabled")]
15 VaultIsDisabled = 0x1770,
16 #[error("Exceeded slippage tolerance")]
18 ExceededSlippage = 0x1771,
19 #[error("Strategy is not existed")]
21 StrategyIsNotExisted = 0x1772,
22 #[error("UnAuthorized")]
24 UnAuthorized = 0x1773,
25 #[error("Math operation overflow")]
27 MathOverflow = 0x1774,
28 #[error("Protocol is not supported")]
30 ProtocolIsNotSupported = 0x1775,
31 #[error("Reserve does not support token mint")]
33 UnMatchReserve = 0x1776,
34 #[error("lockedProfitDegradation is invalid")]
36 InvalidLockedProfitDegradation = 0x1777,
37 #[error("Maximum number of strategies have been reached")]
39 MaxStrategyReached = 0x1778,
40 #[error("Strategy existed")]
42 StrategyExisted = 0x1779,
43 #[error("Invalid unmint amount")]
45 InvalidUnmintAmount = 0x177A,
46 #[error("Invalid accounts for strategy")]
48 InvalidAccountsForStrategy = 0x177B,
49 #[error("Invalid bump")]
51 InvalidBump = 0x177C,
52 #[error("Amount must be greater than 0")]
54 AmountMustGreaterThanZero = 0x177D,
55 #[error("Mango is not supported anymore")]
57 MangoIsNotSupportedAnymore = 0x177E,
58 #[error("Strategy is not supported")]
60 StrategyIsNotSupported = 0x177F,
61 #[error("Pay amount is exceeded")]
63 PayAmountIsExeeced = 0x1780,
64 #[error("Fee vault is not set")]
66 FeeVaultIsNotSet = 0x1781,
67 #[error("deposit amount in lending is not matched")]
69 LendingAssertionViolation = 0x1782,
70 #[error("Cannot remove strategy becase we have some in lending")]
72 HaveMoneyInLending = 0x1783,
73}
74
75impl solana_program::program_error::PrintProgramError for VaultError {
76 fn print<E>(&self) {
77 solana_program::msg!(&self.to_string());
78 }
79}
80
81impl<T> solana_program::decode_error::DecodeError<T> for VaultError {
82 fn type_of() -> &'static str {
83 "VaultError"
84 }
85}