solana_address_lookup_table_program/
error.rs1#[cfg(not(target_os = "solana"))]
2use solana_program::message::AddressLoaderError;
3use thiserror::Error;
4
5#[derive(Debug, Error, PartialEq, Eq, Clone)]
6pub enum AddressLookupError {
7 #[error("Attempted to lookup addresses from a table that does not exist")]
9 LookupTableAccountNotFound,
10
11 #[error("Attempted to lookup addresses from an account owned by the wrong program")]
13 InvalidAccountOwner,
14
15 #[error("Attempted to lookup addresses from an invalid account")]
17 InvalidAccountData,
18
19 #[error("Address lookup contains an invalid index")]
21 InvalidLookupIndex,
22}
23
24#[cfg(not(target_os = "solana"))]
25impl From<AddressLookupError> for AddressLoaderError {
26 fn from(err: AddressLookupError) -> Self {
27 match err {
28 AddressLookupError::LookupTableAccountNotFound => Self::LookupTableAccountNotFound,
29 AddressLookupError::InvalidAccountOwner => Self::InvalidAccountOwner,
30 AddressLookupError::InvalidAccountData => Self::InvalidAccountData,
31 AddressLookupError::InvalidLookupIndex => Self::InvalidLookupIndex,
32 }
33 }
34}