pub enum ProgramError {
Show 24 variants
Custom(u32),
InvalidArgument,
InvalidInstructionData,
InvalidAccountData,
AccountDataTooSmall,
InsufficientFunds,
IncorrectProgramId,
MissingRequiredSignature,
AccountAlreadyInitialized,
UninitializedAccount,
NotEnoughAccountKeys,
AccountBorrowFailed,
MaxSeedLengthExceeded,
InvalidSeeds,
BorshIoError(String),
AccountNotRentExempt,
UnsupportedSysvar,
IllegalOwner,
MaxAccountsDataAllocationsExceeded,
InvalidRealloc,
MaxInstructionTraceLengthExceeded,
BuiltinProgramsMustConsumeComputeUnits,
InvalidAccountOwner,
ArithmeticOverflow,
}
Expand description
Reasons the program may fail
Variants§
Custom(u32)
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.
InvalidArgument
InvalidInstructionData
InvalidAccountData
AccountDataTooSmall
InsufficientFunds
IncorrectProgramId
MissingRequiredSignature
AccountAlreadyInitialized
UninitializedAccount
NotEnoughAccountKeys
AccountBorrowFailed
MaxSeedLengthExceeded
InvalidSeeds
BorshIoError(String)
AccountNotRentExempt
UnsupportedSysvar
IllegalOwner
MaxAccountsDataAllocationsExceeded
InvalidRealloc
MaxInstructionTraceLengthExceeded
BuiltinProgramsMustConsumeComputeUnits
InvalidAccountOwner
ArithmeticOverflow
Trait Implementations§
§impl Clone for ProgramError
impl Clone for ProgramError
§fn clone(&self) -> ProgramError
fn clone(&self) -> ProgramError
Returns a copy 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 more§impl Debug for ProgramError
impl Debug for ProgramError
§impl<'de> Deserialize<'de> for ProgramError
impl<'de> Deserialize<'de> for ProgramError
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ProgramError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ProgramError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ProgramError
impl Display for ProgramError
§impl Error for ProgramError
impl Error for ProgramError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§impl From<AccountResolutionError> for ProgramError
impl From<AccountResolutionError> for ProgramError
§fn from(e: AccountResolutionError) -> ProgramError
fn from(e: AccountResolutionError) -> ProgramError
Converts to this type from the input type.
§impl From<AccountResolutionError> for ProgramError
impl From<AccountResolutionError> for ProgramError
§fn from(e: AccountResolutionError) -> ProgramError
fn from(e: AccountResolutionError) -> ProgramError
Converts to this type from the input type.
§impl From<AssociatedTokenAccountError> for ProgramError
impl From<AssociatedTokenAccountError> for ProgramError
§fn from(e: AssociatedTokenAccountError) -> ProgramError
fn from(e: AssociatedTokenAccountError) -> ProgramError
Converts to this type from the input type.
§impl From<Error> for ProgramError
impl From<Error> for ProgramError
§fn from(error: Error) -> ProgramError
fn from(error: Error) -> ProgramError
Converts to this type from the input type.
§impl From<Error> for ProgramError
impl From<Error> for ProgramError
§fn from(e: Error) -> ProgramError
fn from(e: Error) -> ProgramError
Converts to this type from the input type.
§impl From<PodSliceError> for ProgramError
impl From<PodSliceError> for ProgramError
§fn from(e: PodSliceError) -> ProgramError
fn from(e: PodSliceError) -> ProgramError
Converts to this type from the input type.
§impl From<ProgramError> for Error
impl From<ProgramError> for Error
§fn from(program_error: ProgramError) -> Error
fn from(program_error: ProgramError) -> Error
Converts to this type from the input type.
§impl From<ProgramError> for ProgramErrorWithOrigin
impl From<ProgramError> for ProgramErrorWithOrigin
§fn from(program_error: ProgramError) -> ProgramErrorWithOrigin
fn from(program_error: ProgramError) -> ProgramErrorWithOrigin
Converts to this type from the input type.
§impl From<PubkeyError> for ProgramError
impl From<PubkeyError> for ProgramError
§fn from(error: PubkeyError) -> ProgramError
fn from(error: PubkeyError) -> ProgramError
Converts to this type from the input type.
§impl From<TlvError> for ProgramError
impl From<TlvError> for ProgramError
§fn from(e: TlvError) -> ProgramError
fn from(e: TlvError) -> ProgramError
Converts to this type from the input type.
§impl From<TokenError> for ProgramError
impl From<TokenError> for ProgramError
§fn from(e: TokenError) -> ProgramError
fn from(e: TokenError) -> ProgramError
Converts to this type from the input type.
§impl From<TokenError> for ProgramError
impl From<TokenError> for ProgramError
§fn from(e: TokenError) -> ProgramError
fn from(e: TokenError) -> ProgramError
Converts to this type from the input type.
§impl From<TokenError> for ProgramError
impl From<TokenError> for ProgramError
§fn from(e: TokenError) -> ProgramError
fn from(e: TokenError) -> ProgramError
Converts to this type from the input type.
§impl From<TokenGroupError> for ProgramError
impl From<TokenGroupError> for ProgramError
§fn from(e: TokenGroupError) -> ProgramError
fn from(e: TokenGroupError) -> ProgramError
Converts to this type from the input type.
§impl From<TokenMetadataError> for ProgramError
impl From<TokenMetadataError> for ProgramError
§fn from(e: TokenMetadataError) -> ProgramError
fn from(e: TokenMetadataError) -> ProgramError
Converts to this type from the input type.
§impl From<TransferHookError> for ProgramError
impl From<TransferHookError> for ProgramError
§fn from(e: TransferHookError) -> ProgramError
fn from(e: TransferHookError) -> ProgramError
Converts to this type from the input type.
§impl From<TransferHookError> for ProgramError
impl From<TransferHookError> for ProgramError
§fn from(e: TransferHookError) -> ProgramError
fn from(e: TransferHookError) -> ProgramError
Converts to this type from the input type.
§impl From<u64> for ProgramError
impl From<u64> for ProgramError
§fn from(error: u64) -> ProgramError
fn from(error: u64) -> ProgramError
Converts to this type from the input type.
§impl PartialEq for ProgramError
impl PartialEq for ProgramError
§fn eq(&self, other: &ProgramError) -> bool
fn eq(&self, other: &ProgramError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PrintProgramError for ProgramError
impl PrintProgramError for ProgramError
fn print<E>(&self)where
E: 'static + Error + DecodeError<E> + PrintProgramError + FromPrimitive,
§impl Serialize for ProgramError
impl Serialize for ProgramError
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<InstructionError> for ProgramError
impl TryFrom<InstructionError> for ProgramError
§fn try_from(
error: InstructionError
) -> Result<ProgramError, <ProgramError as TryFrom<InstructionError>>::Error>
fn try_from( error: InstructionError ) -> Result<ProgramError, <ProgramError as TryFrom<InstructionError>>::Error>
Performs the conversion.
impl Eq for ProgramError
impl StructuralPartialEq for ProgramError
Auto Trait Implementations§
impl RefUnwindSafe for ProgramError
impl Send for ProgramError
impl Sync for ProgramError
impl Unpin for ProgramError
impl UnwindSafe for ProgramError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.