solana_system_client/generated/errors/
system.rs

1//! This code was AUTOGENERATED using the kinobi library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun kinobi to update it.
4//!
5//! <https://github.com/kinobi-so/kinobi>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum SystemError {
13    /// 0 - an account with the same address already exists
14    #[error("an account with the same address already exists")]
15    AccountAlreadyInUse = 0x0,
16    /// 1 - account does not have enough SOL to perform the operation
17    #[error("account does not have enough SOL to perform the operation")]
18    ResultWithNegativeLamports = 0x1,
19    /// 2 - cannot assign account to this program id
20    #[error("cannot assign account to this program id")]
21    InvalidProgramId = 0x2,
22    /// 3 - cannot allocate account data of this length
23    #[error("cannot allocate account data of this length")]
24    InvalidAccountDataLength = 0x3,
25    /// 4 - length of requested seed is too long
26    #[error("length of requested seed is too long")]
27    MaxSeedLengthExceeded = 0x4,
28    /// 5 - provided address does not match addressed derived from seed
29    #[error("provided address does not match addressed derived from seed")]
30    AddressWithSeedMismatch = 0x5,
31    /// 6 - advancing stored nonce requires a populated RecentBlockhashes sysvar
32    #[error("advancing stored nonce requires a populated RecentBlockhashes sysvar")]
33    NonceNoRecentBlockhashes = 0x6,
34    /// 7 - stored nonce is still in recent_blockhashes
35    #[error("stored nonce is still in recent_blockhashes")]
36    NonceBlockhashNotExpired = 0x7,
37    /// 8 - specified nonce does not match stored nonce
38    #[error("specified nonce does not match stored nonce")]
39    NonceUnexpectedBlockhashValue = 0x8,
40}
41
42impl solana_program::program_error::PrintProgramError for SystemError {
43    fn print<E>(&self) {
44        solana_program::msg!(&self.to_string());
45    }
46}