@@ -7,6 +7,7 @@ use thiserror::Error;
77/// Errors that may be returned by the TokenLending program.
88#[ derive( Clone , Debug , Eq , Error , FromPrimitive , PartialEq ) ]
99pub enum LendingError {
10+ // 0
1011 /// Invalid instruction data passed in.
1112 #[ error( "Failed to unpack instruction data" ) ]
1213 InstructionUnpackError ,
@@ -22,6 +23,8 @@ pub enum LendingError {
2223 /// Expected a different market owner
2324 #[ error( "Market owner is invalid" ) ]
2425 InvalidMarketOwner ,
26+
27+ // 5
2528 /// The owner of the input isn't set to the program address generated by the program.
2629 #[ error( "Input account owner is not the program address" ) ]
2730 InvalidAccountOwner ,
@@ -37,6 +40,8 @@ pub enum LendingError {
3740 /// Invalid amount, must be greater than zero
3841 #[ error( "Input amount is invalid" ) ]
3942 InvalidAmount ,
43+
44+ // 10
4045 /// Invalid config value
4146 #[ error( "Input config value is invalid" ) ]
4247 InvalidConfig ,
@@ -53,6 +58,7 @@ pub enum LendingError {
5358 #[ error( "Interest rate is negative" ) ]
5459 NegativeInterestRate ,
5560
61+ // 15
5662 /// Memory is too small
5763 #[ error( "Memory is too small" ) ]
5864 MemoryTooSmall ,
@@ -68,6 +74,8 @@ pub enum LendingError {
6874 /// Insufficient liquidity available
6975 #[ error( "Insufficient liquidity available" ) ]
7076 InsufficientLiquidity ,
77+
78+ // 20
7179 /// This reserve's collateral cannot be used for borrows
7280 #[ error( "Input reserve has collateral disabled" ) ]
7381 ReserveCollateralDisabled ,
@@ -77,12 +85,14 @@ pub enum LendingError {
7785 /// Input reserves cannot use the same liquidity mint
7886 #[ error( "Input reserves cannot use the same liquidity mint" ) ]
7987 DuplicateReserveMint ,
80- /// Obligation amount is too small to pay off
81- #[ error( "Obligation amount is too small to pay off " ) ]
82- ObligationTooSmall ,
88+ /// Obligation amount is empty
89+ #[ error( "Obligation amount is empty " ) ]
90+ ObligationEmpty ,
8391 /// Cannot liquidate healthy obligations
8492 #[ error( "Cannot liquidate healthy obligations" ) ]
8593 HealthyObligation ,
94+
95+ // 25
8696 /// Borrow amount too small
8797 #[ error( "Borrow amount too small" ) ]
8898 BorrowTooSmall ,
@@ -92,14 +102,14 @@ pub enum LendingError {
92102 /// Reserve state stale
93103 #[ error( "Reserve state needs to be updated for the current slot" ) ]
94104 ReserveStale ,
95-
96105 /// Trade simulation error
97106 #[ error( "Trade simulation error" ) ]
98107 TradeSimulationError ,
99108 /// Invalid dex order book side
100109 #[ error( "Invalid dex order book side" ) ]
101110 DexInvalidOrderBookSide ,
102111
112+ // 30
103113 /// Token initialize mint failed
104114 #[ error( "Token initialize mint failed" ) ]
105115 TokenInitializeMintFailed ,
0 commit comments