lighthouse_sol/errors/
lighthouse.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum LighthouseError {
13    /// 6000 - Invalid instruction
14    #[error("Invalid instruction")]
15    InvalidInstructionData = 0x1770,
16    /// 6001 - AssertionFailed
17    #[error("AssertionFailed")]
18    AssertionFailed = 0x1771,
19    /// 6002 - NotEnoughAccounts
20    #[error("NotEnoughAccounts")]
21    NotEnoughAccounts = 0x1772,
22    /// 6003 - BumpNotFound
23    #[error("BumpNotFound")]
24    BumpNotFound = 0x1773,
25    /// 6004 - AccountBorrowFailed
26    #[error("AccountBorrowFailed")]
27    AccountBorrowFailed = 0x1774,
28    /// 6005 - RangeOutOfBounds
29    #[error("RangeOutOfBounds")]
30    RangeOutOfBounds = 0x1775,
31    /// 6006 - IndexOutOfBounds
32    #[error("IndexOutOfBounds")]
33    IndexOutOfBounds = 0x1776,
34    /// 6007 - FailedToDeserialize
35    #[error("FailedToDeserialize")]
36    FailedToDeserialize = 0x1777,
37    /// 6008 - FailedToSerialize
38    #[error("FailedToSerialize")]
39    FailedToSerialize = 0x1778,
40    /// 6009 - AccountOwnerMismatch
41    #[error("AccountOwnerMismatch")]
42    AccountOwnerMismatch = 0x1779,
43    /// 6010 - AccountKeyMismatch
44    #[error("AccountKeyMismatch")]
45    AccountKeyMismatch = 0x177A,
46    /// 6011 - AccountNotInitialized
47    #[error("AccountNotInitialized")]
48    AccountNotInitialized = 0x177B,
49    /// 6012 - AccountOwnerValidationFailed
50    #[error("AccountOwnerValidationFailed")]
51    AccountOwnerValidationFailed = 0x177C,
52    /// 6013 - AccountFundedValidationFailed
53    #[error("AccountFundedValidationFailed")]
54    AccountFundedValidationFailed = 0x177D,
55    /// 6014 - AccountDiscriminatorValidationFailed
56    #[error("AccountDiscriminatorValidationFailed")]
57    AccountDiscriminatorValidationFailed = 0x177E,
58    /// 6015 - AccountValidaitonFailed
59    #[error("AccountValidaitonFailed")]
60    AccountValidationFailed = 0x177F,
61    /// 6016 - CrossProgramInvokeViolation
62    #[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}