lighthouse_sol/errors/
lighthouse.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum LighthouseError {
13 #[error("Invalid instruction")]
15 InvalidInstructionData = 0x1770,
16 #[error("AssertionFailed")]
18 AssertionFailed = 0x1771,
19 #[error("NotEnoughAccounts")]
21 NotEnoughAccounts = 0x1772,
22 #[error("BumpNotFound")]
24 BumpNotFound = 0x1773,
25 #[error("AccountBorrowFailed")]
27 AccountBorrowFailed = 0x1774,
28 #[error("RangeOutOfBounds")]
30 RangeOutOfBounds = 0x1775,
31 #[error("IndexOutOfBounds")]
33 IndexOutOfBounds = 0x1776,
34 #[error("FailedToDeserialize")]
36 FailedToDeserialize = 0x1777,
37 #[error("FailedToSerialize")]
39 FailedToSerialize = 0x1778,
40 #[error("AccountOwnerMismatch")]
42 AccountOwnerMismatch = 0x1779,
43 #[error("AccountKeyMismatch")]
45 AccountKeyMismatch = 0x177A,
46 #[error("AccountNotInitialized")]
48 AccountNotInitialized = 0x177B,
49 #[error("AccountOwnerValidationFailed")]
51 AccountOwnerValidationFailed = 0x177C,
52 #[error("AccountFundedValidationFailed")]
54 AccountFundedValidationFailed = 0x177D,
55 #[error("AccountDiscriminatorValidationFailed")]
57 AccountDiscriminatorValidationFailed = 0x177E,
58 #[error("AccountValidaitonFailed")]
60 AccountValidationFailed = 0x177F,
61 #[error("CrossProgramInvokeViolation")]
63 CrossProgramInvokeViolation = 0x1780,
64}
65
66impl solana_program_error::PrintProgramError for LighthouseError {
67 fn print<E>(&self) {
68 solana_msg::msg!(&self.to_string());
69 }
70}
71
72impl<T> solana_decode_error::DecodeError<T> for LighthouseError {
73 fn type_of() -> &'static str {
74 "LighthouseError"
75 }
76}