Enum solana_sdk::program_error::ProgramError
source · [−]pub enum ProgramError {
Show 20 variants
Custom(u32),
InvalidArgument,
InvalidInstructionData,
InvalidAccountData,
AccountDataTooSmall,
InsufficientFunds,
IncorrectProgramId,
MissingRequiredSignature,
AccountAlreadyInitialized,
UninitializedAccount,
NotEnoughAccountKeys,
AccountBorrowFailed,
MaxSeedLengthExceeded,
InvalidSeeds,
BorshIoError(String),
AccountNotRentExempt,
UnsupportedSysvar,
IllegalOwner,
AccountsDataBudgetExceeded,
ActiveVoteAccountClose,
}
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
AccountsDataBudgetExceeded
ActiveVoteAccountClose
Trait Implementations
sourceimpl Clone for ProgramError
impl Clone for ProgramError
sourcepub fn clone(&self) -> ProgramError
pub fn clone(&self) -> ProgramError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ProgramError
impl Debug for ProgramError
sourceimpl<'de> Deserialize<'de> for ProgramError
impl<'de> Deserialize<'de> for ProgramError
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<ProgramError, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub 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
sourceimpl Display for ProgramError
impl Display for ProgramError
sourceimpl Error for ProgramError
impl Error for ProgramError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<Error> for ProgramError
impl From<Error> for ProgramError
sourcepub fn from(error: Error) -> ProgramError
pub fn from(error: Error) -> ProgramError
Performs the conversion.
sourceimpl From<PubkeyError> for ProgramError
impl From<PubkeyError> for ProgramError
sourcepub fn from(error: PubkeyError) -> ProgramError
pub fn from(error: PubkeyError) -> ProgramError
Performs the conversion.
sourceimpl From<u64> for ProgramError
impl From<u64> for ProgramError
sourcepub fn from(error: u64) -> ProgramError
pub fn from(error: u64) -> ProgramError
Performs the conversion.
sourceimpl PartialEq<ProgramError> for ProgramError
impl PartialEq<ProgramError> for ProgramError
sourcepub fn eq(&self, other: &ProgramError) -> bool
pub fn eq(&self, other: &ProgramError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &ProgramError) -> bool
pub fn ne(&self, other: &ProgramError) -> bool
This method tests for !=
.
sourceimpl PrintProgramError for ProgramError
impl PrintProgramError for ProgramError
pub fn print<E>(&self) where
E: 'static + Error + DecodeError<E> + PrintProgramError + FromPrimitive,
sourceimpl Serialize for ProgramError
impl Serialize for ProgramError
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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
sourceimpl TryFrom<InstructionError> for ProgramError
impl TryFrom<InstructionError> for ProgramError
type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.
sourcepub fn try_from(
error: InstructionError
) -> Result<ProgramError, <ProgramError as TryFrom<InstructionError>>::Error>
pub fn try_from(
error: InstructionError
) -> Result<ProgramError, <ProgramError as TryFrom<InstructionError>>::Error>
Performs the conversion.
impl Eq for ProgramError
impl StructuralEq 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
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
impl<T> AsFail for T where
T: Fail,
impl<T> AsFail for T where
T: Fail,
pub fn as_fail(&self) -> &(dyn Fail + 'static)
pub fn as_fail(&self) -> &(dyn Fail + 'static)
Converts a reference to Self
into a dynamic trait object of Fail
.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
fn cause(&self) -> Option<&(dyn Fail + 'static)>
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>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the Backtrace
carried by this failure, if it
carries one. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more