#[repr(u64)]pub enum ProgramError {
Show 26 variants
Custom(u32),
InvalidArgument = 1,
InvalidInstructionData = 2,
InvalidAccountData = 3,
AccountDataTooSmall = 4,
InsufficientFunds = 5,
IncorrectProgramId = 6,
MissingRequiredSignature = 7,
AccountAlreadyInitialized = 8,
UninitializedAccount = 9,
NotEnoughAccountKeys = 10,
AccountBorrowFailed = 11,
MaxSeedLengthExceeded = 12,
InvalidSeeds = 13,
BorshIoError = 14,
AccountNotRentExempt = 15,
UnsupportedSysvar = 16,
IllegalOwner = 17,
MaxAccountsDataAllocationsExceeded = 18,
InvalidRealloc = 19,
MaxInstructionTraceLengthExceeded = 20,
BuiltinProgramsMustConsumeComputeUnits = 21,
InvalidAccountOwner = 22,
ArithmeticOverflow = 23,
Immutable = 24,
IncorrectAuthority = 25,
}Expand description
Errors that a Solana program can return.
#[repr(u64)] with EXPLICIT discriminants is load-bearing for binary
size: variant k (for the fieldless builtins, k = 1..=24) encodes to
the runtime code (k + 1) << 32, so [From<ProgramError> for u64] is
one tag read + one shift instead of a 25-arm match. The DWARF size
attribution measured that match at 880 bytes, 13% of the parity
vault’s .text, because the error lowering inlines into every
entrypoint. Keep new variants in this scheme: append with the next
sequential discriminant and the conversion stays arm-free (the
exhaustive u64_conversion_matches_reference_for_every_variant test
enforces the correspondence).
Variants§
Custom(u32)
Custom program error with a u32 code.
InvalidArgument = 1
InvalidInstructionData = 2
InvalidAccountData = 3
AccountDataTooSmall = 4
InsufficientFunds = 5
IncorrectProgramId = 6
MissingRequiredSignature = 7
AccountAlreadyInitialized = 8
UninitializedAccount = 9
NotEnoughAccountKeys = 10
AccountBorrowFailed = 11
MaxSeedLengthExceeded = 12
InvalidSeeds = 13
BorshIoError = 14
AccountNotRentExempt = 15
UnsupportedSysvar = 16
IllegalOwner = 17
MaxAccountsDataAllocationsExceeded = 18
InvalidRealloc = 19
MaxInstructionTraceLengthExceeded = 20
BuiltinProgramsMustConsumeComputeUnits = 21
InvalidAccountOwner = 22
ArithmeticOverflow = 23
Immutable = 24
IncorrectAuthority = 25
Trait Implementations§
Source§impl Clone for ProgramError
impl Clone for ProgramError
Source§impl Debug for ProgramError
impl Debug for ProgramError
Source§impl Display for ProgramError
impl Display for ProgramError
impl Eq for ProgramError
Source§impl From<ProgramError> for u64
impl From<ProgramError> for u64
Source§fn from(err: ProgramError) -> u64
fn from(err: ProgramError) -> u64
Converts to this type from the input type.
Source§impl From<u64> for ProgramError
impl From<u64> for ProgramError
Source§impl PartialEq for ProgramError
impl PartialEq for ProgramError
impl StructuralPartialEq for ProgramError
Auto Trait Implementations§
impl Freeze for ProgramError
impl RefUnwindSafe for ProgramError
impl Send for ProgramError
impl Sync for ProgramError
impl Unpin for ProgramError
impl UnsafeUnpin for ProgramError
impl UnwindSafe for ProgramError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more