#[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.
This is part of the Hopper runtime type surface. Variant discriminants match the Solana runtime ABI.
#[repr(u64)] with EXPLICIT sequential discriminants is load-bearing
for binary size, exactly as on hopper_native::error::ProgramError
(which this type mirrors variant-for-variant): fieldless variant k
encodes to the runtime code (k + 1) << 32, so the u64 lowering is
one tag read + one shift instead of a 25-arm match inlined into every
entrypoint, and the native<->runtime glue converts by ROUND-TRIPPING
the u64 code instead of two more 25-arm identity matches. The DWARF
size attribution measured the match forms at 880 bytes, 13% of the
parity vault’s .text. Append new variants with the next sequential
discriminant, mirrored in the native enum; the exhaustive tests below
refuse to compile otherwise.
Variants§
Custom(u32)
Custom program error with a u32 code.