pub enum ProgramError {
Show 26 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,
Immutable,
IncorrectAuthority,
}
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
Immutable
IncorrectAuthority
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<'de> Deserialize<'de> for ProgramError
impl<'de> Deserialize<'de> for ProgramError
Source§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
Source§impl Display for ProgramError
impl Display for ProgramError
Source§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)>
Returns 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()
Source§impl From<AccountError> for ProgramError
impl From<AccountError> for ProgramError
Source§fn from(e: AccountError) -> ProgramError
fn from(e: AccountError) -> ProgramError
Converts to this type from the input type.
Source§impl From<BatchedMerkleTreeError> for ProgramError
impl From<BatchedMerkleTreeError> for ProgramError
Source§fn from(e: BatchedMerkleTreeError) -> ProgramError
fn from(e: BatchedMerkleTreeError) -> ProgramError
Converts to this type from the input type.
Source§impl From<BloomFilterError> for ProgramError
impl From<BloomFilterError> for ProgramError
Source§fn from(e: BloomFilterError) -> ProgramError
fn from(e: BloomFilterError) -> ProgramError
Converts to this type from the input type.
Source§impl From<BoundedVecError> for ProgramError
impl From<BoundedVecError> for ProgramError
Source§fn from(e: BoundedVecError) -> ProgramError
fn from(e: BoundedVecError) -> ProgramError
Converts to this type from the input type.
Source§impl From<CompressedAccountError> for ProgramError
impl From<CompressedAccountError> for ProgramError
Source§fn from(e: CompressedAccountError) -> ProgramError
fn from(e: CompressedAccountError) -> ProgramError
Converts to this type from the input type.
Source§impl From<ConcurrentMerkleTreeError> for ProgramError
impl From<ConcurrentMerkleTreeError> for ProgramError
Source§fn from(e: ConcurrentMerkleTreeError) -> ProgramError
fn from(e: ConcurrentMerkleTreeError) -> ProgramError
Converts to this type from the input type.
Source§impl From<Error> for ProgramError
impl From<Error> for ProgramError
Source§fn from(e: Error) -> ProgramError
fn from(e: Error) -> ProgramError
Converts to this type from the input type.
Source§impl From<Error> for ProgramError
impl From<Error> for ProgramError
Source§fn from(error: Error) -> ProgramError
fn from(error: Error) -> ProgramError
Converts to this type from the input type.
Source§impl From<HashSetError> for ProgramError
impl From<HashSetError> for ProgramError
Source§fn from(e: HashSetError) -> ProgramError
fn from(e: HashSetError) -> ProgramError
Converts to this type from the input type.
Source§impl From<HasherError> for ProgramError
impl From<HasherError> for ProgramError
Source§fn from(e: HasherError) -> ProgramError
fn from(e: HasherError) -> ProgramError
Converts to this type from the input type.
Source§impl From<IndexedMerkleTreeError> for ProgramError
impl From<IndexedMerkleTreeError> for ProgramError
Source§fn from(e: IndexedMerkleTreeError) -> ProgramError
fn from(e: IndexedMerkleTreeError) -> ProgramError
Converts to this type from the input type.
Source§impl From<MerkleTreeMetadataError> for ProgramError
impl From<MerkleTreeMetadataError> for ProgramError
Source§fn from(e: MerkleTreeMetadataError) -> ProgramError
fn from(e: MerkleTreeMetadataError) -> ProgramError
Converts to this type from the input type.
Source§impl From<ProgramError> for Error
impl From<ProgramError> for Error
Source§fn from(program_error: ProgramError) -> Error
fn from(program_error: ProgramError) -> Error
Converts to this type from the input type.
Source§impl From<ProgramError> for ProgramErrorWithOrigin
impl From<ProgramError> for ProgramErrorWithOrigin
Source§fn from(program_error: ProgramError) -> ProgramErrorWithOrigin
fn from(program_error: ProgramError) -> ProgramErrorWithOrigin
Converts to this type from the input type.
Source§impl From<PubkeyError> for ProgramError
impl From<PubkeyError> for ProgramError
Source§fn from(error: PubkeyError) -> ProgramError
fn from(error: PubkeyError) -> ProgramError
Converts to this type from the input type.
Source§impl From<StakeError> for ProgramError
impl From<StakeError> for ProgramError
Source§fn from(e: StakeError) -> ProgramError
fn from(e: StakeError) -> ProgramError
Converts to this type from the input type.
Source§impl From<ZeroCopyError> for ProgramError
impl From<ZeroCopyError> for ProgramError
Source§fn from(e: ZeroCopyError) -> ProgramError
fn from(e: ZeroCopyError) -> ProgramError
Converts to this type from the input type.
Source§impl From<u64> for ProgramError
impl From<u64> for ProgramError
Source§fn from(error: u64) -> ProgramError
fn from(error: u64) -> ProgramError
Converts to this type from the input type.
Source§impl PartialEq for ProgramError
impl PartialEq for ProgramError
Source§impl PrintProgramError for ProgramError
impl PrintProgramError for ProgramError
Source§impl Serialize for ProgramError
impl Serialize for ProgramError
Source§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
Source§impl ToStr for ProgramError
impl ToStr for ProgramError
Source§impl TryFrom<InstructionError> for ProgramError
impl TryFrom<InstructionError> for ProgramError
Source§type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.
Source§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 Freeze for ProgramError
impl RefUnwindSafe for ProgramError
impl Send for ProgramError
impl Sync for ProgramError
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.