Enum solana_sdk::instruction::InstructionError[][src]

pub enum InstructionError {
Show variants GenericError, InvalidArgument, InvalidInstructionData, InvalidAccountData, AccountDataTooSmall, InsufficientFunds, IncorrectProgramId, MissingRequiredSignature, AccountAlreadyInitialized, UninitializedAccount, UnbalancedInstruction, ModifiedProgramId, ExternalAccountLamportSpend, ExternalAccountDataModified, ReadonlyLamportChange, ReadonlyDataModified, DuplicateAccountIndex, ExecutableModified, RentEpochModified, NotEnoughAccountKeys, AccountDataSizeChanged, AccountNotExecutable, AccountBorrowFailed, AccountBorrowOutstanding, DuplicateAccountOutOfSync, Custom(u32), InvalidError, ExecutableDataModified, ExecutableLamportChange, ExecutableAccountNotRentExempt, UnsupportedProgramId, CallDepth, MissingAccount, ReentrancyNotAllowed, MaxSeedLengthExceeded, InvalidSeeds, InvalidRealloc, ComputationalBudgetExceeded, PrivilegeEscalation, ProgramEnvironmentSetupFailure, ProgramFailedToComplete, ProgramFailedToCompile, Immutable, IncorrectAuthority, BorshIoError(String), AccountNotRentExempt, InvalidAccountOwner, ArithmeticOverflow, UnsupportedSysvar,
}
Expand description

Reasons the runtime might have rejected an instruction.

Variants

GenericError
Expand description

Deprecated! Use CustomError instead! The program instruction returned an error

InvalidArgument
Expand description

The arguments provided to a program were invalid

InvalidInstructionData
Expand description

An instruction’s data contents were invalid

InvalidAccountData
Expand description

An account’s data contents was invalid

AccountDataTooSmall
Expand description

An account’s data was too small

InsufficientFunds
Expand description

An account’s balance was too small to complete the instruction

IncorrectProgramId
Expand description

The account did not have the expected program id

MissingRequiredSignature
Expand description

A signature was required but not found

AccountAlreadyInitialized
Expand description

An initialize instruction was sent to an account that has already been initialized.

UninitializedAccount
Expand description

An attempt to operate on an account that hasn’t been initialized.

UnbalancedInstruction
Expand description

Program’s instruction lamport balance does not equal the balance after the instruction

ModifiedProgramId
Expand description

Program modified an account’s program id

ExternalAccountLamportSpend
Expand description

Program spent the lamports of an account that doesn’t belong to it

ExternalAccountDataModified
Expand description

Program modified the data of an account that doesn’t belong to it

ReadonlyLamportChange
Expand description

Read-only account’s lamports modified

ReadonlyDataModified
Expand description

Read-only account’s data was modified

DuplicateAccountIndex
Expand description

An account was referenced more than once in a single instruction

ExecutableModified
Expand description

Executable bit on account changed, but shouldn’t have

RentEpochModified
Expand description

Rent_epoch account changed, but shouldn’t have

NotEnoughAccountKeys
Expand description

The instruction expected additional account keys

AccountDataSizeChanged
Expand description

A non-system program changed the size of the account data

AccountNotExecutable
Expand description

The instruction expected an executable account

AccountBorrowFailed
Expand description

Failed to borrow a reference to account data, already borrowed

AccountBorrowOutstanding
Expand description

Account data has an outstanding reference after a program’s execution

DuplicateAccountOutOfSync
Expand description

The same account was multiply passed to an on-chain program’s entrypoint, but the program modified them differently. A program can only modify one instance of the account because the runtime cannot determine which changes to pick or how to merge them if both are modified

Custom(u32)
Expand description

Allows on-chain programs to implement program-specific error types and see them returned by the Solana runtime. A program-specific error may be any type that is represented as or serialized to a u32 integer.

InvalidError
Expand description

The return value from the program was invalid. Valid errors are either a defined builtin error value or a user-defined error in the lower 32 bits.

ExecutableDataModified
Expand description

Executable account’s data was modified

ExecutableLamportChange
Expand description

Executable account’s lamports modified

ExecutableAccountNotRentExempt
Expand description

Executable accounts must be rent exempt

UnsupportedProgramId
Expand description

Unsupported program id

CallDepth
Expand description

Cross-program invocation call depth too deep

MissingAccount
Expand description

An account required by the instruction is missing

ReentrancyNotAllowed
Expand description

Cross-program invocation reentrancy not allowed for this instruction

MaxSeedLengthExceeded
Expand description

Length of the seed is too long for address generation

InvalidSeeds
Expand description

Provided seeds do not result in a valid address

InvalidRealloc
Expand description

Failed to reallocate account data of this length

ComputationalBudgetExceeded
Expand description

Computational budget exceeded

PrivilegeEscalation
Expand description

Cross-program invocation with unauthorized signer or writable account

ProgramEnvironmentSetupFailure
Expand description

Failed to create program execution environment

ProgramFailedToComplete
Expand description

Program failed to complete

ProgramFailedToCompile
Expand description

Program failed to compile

Immutable
Expand description

Account is immutable

IncorrectAuthority
Expand description

Incorrect authority provided

BorshIoError(String)
Expand description

Failed to serialize or deserialize account data

AccountNotRentExempt
Expand description

An account does not have enough lamports to be rent-exempt

InvalidAccountOwner
Expand description

Invalid account owner

ArithmeticOverflow
Expand description

Program arithmetic overflowed

UnsupportedSysvar
Expand description

Unsupported sysvar

Trait Implementations

impl AbiEnumVisitor for InstructionError[src]

pub fn visit_for_abi(
    &self,
    digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]

impl AbiExample for InstructionError[src]

impl Clone for InstructionError[src]

pub fn clone(&self) -> InstructionError[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for InstructionError[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for InstructionError[src]

pub fn deserialize<__D>(
    __deserializer: __D
) -> Result<InstructionError, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for InstructionError[src]

pub fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Error for InstructionError[src]

fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]

The lower-level source of this error, if any. Read more

fn backtrace(&self) -> Option<&Backtrace>[src]

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

fn description(&self) -> &str1.0.0[src]

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

impl<T> From<T> for InstructionError where
    T: ToPrimitive
[src]

pub fn from(error: T) -> InstructionError[src]

Performs the conversion.

impl PartialEq<InstructionError> for InstructionError[src]

pub fn eq(&self, other: &InstructionError) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &InstructionError) -> bool[src]

This method tests for !=.

impl Serialize for InstructionError[src]

pub fn serialize<__S>(
    &self,
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl TryFrom<InstructionError> for ProgramError[src]

type Error = InstructionError

The type returned in the event of a conversion error.

pub fn try_from(
    error: InstructionError
) -> Result<ProgramError, <ProgramError as TryFrom<InstructionError>>::Error>
[src]

Performs the conversion.

impl Eq for InstructionError[src]

impl StructuralEq for InstructionError[src]

impl StructuralPartialEq for InstructionError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> AbiEnumVisitor for T where
    T: Serialize + AbiExample + ?Sized
[src]

pub default fn visit_for_abi(
    &self,
    digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]

impl<T> AbiEnumVisitor for T where
    T: Serialize + ?Sized
[src]

pub default fn visit_for_abi(
    &self,
    _digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]

impl<T> AbiExample for T[src]

pub default fn example() -> T[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> AsFail for T where
    T: Fail, 

pub fn as_fail(&self) -> &(dyn Fail + 'static)

Converts a reference to Self into a dynamic trait object of Fail.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<E> Fail for E where
    E: 'static + Error + Send + Sync

fn name(&self) -> Option<&str>

Returns the “name” of the error. Read more

fn cause(&self) -> Option<&(dyn Fail + 'static)>

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

fn backtrace(&self) -> Option<&Backtrace>

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

fn context<D>(self, context: D) -> Context<D> where
    D: Display + Send + Sync + 'static, 

Provides context for this failure. Read more

fn compat(self) -> Compat<Self>

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]