pub enum ProgramError {
Show 26 variants
Custom(u32),
InvalidArgument,
InvalidInstructionData,
InvalidAccountData,
AccountDataTooSmall,
InsufficientFunds,
IncorrectProgramId,
MissingRequiredSignature,
AccountAlreadyInitialized,
UninitializedAccount,
NotEnoughAccountKeys,
AccountBorrowFailed,
MaxSeedLengthExceeded,
InvalidSeeds,
BorshIoError,
AccountNotRentExempt,
UnsupportedSysvar,
IllegalOwner,
MaxAccountsDataAllocationsExceeded,
InvalidRealloc,
MaxInstructionTraceLengthExceeded,
BuiltinProgramsMustConsumeComputeUnits,
InvalidAccountOwner,
ArithmeticOverflow,
Immutable,
IncorrectAuthority,
}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.
Variants§
Custom(u32)
Custom program error with a u32 code.
InvalidArgument
InvalidInstructionData
InvalidAccountData
AccountDataTooSmall
InsufficientFunds
IncorrectProgramId
MissingRequiredSignature
AccountAlreadyInitialized
UninitializedAccount
NotEnoughAccountKeys
AccountBorrowFailed
MaxSeedLengthExceeded
InvalidSeeds
BorshIoError
AccountNotRentExempt
UnsupportedSysvar
IllegalOwner
MaxAccountsDataAllocationsExceeded
InvalidRealloc
MaxInstructionTraceLengthExceeded
BuiltinProgramsMustConsumeComputeUnits
InvalidAccountOwner
ArithmeticOverflow
Immutable
IncorrectAuthority
Implementations§
Source§impl ProgramError
impl ProgramError
pub fn err_data_too_small<T>() -> Result<T, Self>
pub fn err_invalid_data<T>() -> Result<T, Self>
pub fn err_missing_signer<T>() -> Result<T, Self>
pub fn err_immutable<T>() -> Result<T, Self>
pub fn err_not_enough_keys<T>() -> Result<T, Self>
pub fn err_borrow_failed<T>() -> Result<T, Self>
pub fn err_overflow<T>() -> Result<T, Self>
pub fn err_invalid_argument<T>() -> Result<T, Self>
pub fn err_incorrect_program<T>() -> Result<T, Self>
Trait Implementations§
Source§impl Clone for ProgramError
impl Clone for ProgramError
Source§fn clone(&self) -> ProgramError
fn clone(&self) -> ProgramError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgramError
impl Debug for ProgramError
Source§impl Display for ProgramError
impl Display for ProgramError
Source§impl From<ProgramError> for ProgramError
Available on crate feature hopper-native-backend only.Convert between Hopper and backend ProgramError via u64 error codes.
impl From<ProgramError> for ProgramError
Available on crate feature
hopper-native-backend only.Convert between Hopper and backend ProgramError via u64 error codes.
Both types encode errors as the same u64 values, so we round-trip through the integer representation. This is zero-cost in the happy path (errors are exceptional).
Source§fn from(e: ProgramError) -> Self
fn from(e: ProgramError) -> Self
Converts to this type from the input type.
Source§impl From<ProgramError> for ProgramError
Available on crate feature hopper-native-backend only.
impl From<ProgramError> for ProgramError
Available on crate feature
hopper-native-backend only.Source§fn from(e: ProgramError) -> Self
fn from(e: ProgramError) -> Self
Converts to this type from the input type.
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<RemainingError> for ProgramError
impl From<RemainingError> for ProgramError
Source§fn from(e: RemainingError) -> Self
fn from(e: RemainingError) -> Self
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 Eq 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