#[repr(i32)]pub enum TransactionErrorCode {
Show 24 variants
Unspecified = 0,
InvalidTransaction = 1,
InvalidSignature = 2,
SignatureVerificationFailed = 3,
TransactionTooLarge = 10,
AccountNotFound = 4,
InvalidAccount = 5,
InvalidBlockhashFormat = 9,
BlockhashNotFound = 11,
ProgramError = 6,
InstructionError = 7,
PrecompileVerificationFailed = 8,
InsufficientFunds = 20,
AccountInUse = 21,
WouldExceedBlockLimit = 22,
TransientSimulationFailure = 23,
NetworkError = 40,
Timeout = 41,
NodeUnhealthy = 42,
RateLimited = 43,
RpcError = 44,
ConnectionFailed = 45,
RequestFailed = 46,
Unknown = 47,
}Expand description
Comprehensive error codes for transaction submission failures
Error classification is based on the “re-signing test” principle:
- If fixing the error requires creating a new transaction with new signatures, it’s PERMANENT
- If the same signed transaction could work later, it’s TEMPORARY
- If we cannot determine whether the transaction was sent, it’s INDETERMINATE
Variants§
Unspecified = 0
InvalidTransaction = 1
Transaction structure or format errors
Malformed transaction structure
InvalidSignature = 2
Missing or invalid signatures
SignatureVerificationFailed = 3
Signature verification failed
TransactionTooLarge = 10
Transaction exceeds size limits
AccountNotFound = 4
Account and validation errors
Required account doesn’t exist
InvalidAccount = 5
Account in invalid state
InvalidBlockhashFormat = 9
Blockhash format is invalid
BlockhashNotFound = 11
Expired blockhash - requires re-signing
ProgramError = 6
Program execution errors
Program execution failed
InstructionError = 7
Instruction execution failed
PrecompileVerificationFailed = 8
Precompile verification failed
InsufficientFunds = 20
Add funds, same transaction works
AccountInUse = 21
Account locked, wait for unlock
WouldExceedBlockLimit = 22
Block capacity limit, try next block
TransientSimulationFailure = 23
Temporary simulation issues
NetworkError = 40
Could fail before/during/after send
Timeout = 41
DANGEROUS - might have been sent
NodeUnhealthy = 42
Node might have received it first
RateLimited = 43
Depends on where rate limiting occurs
RpcError = 44
Generic RPC failures
ConnectionFailed = 45
Connection establishment failed
RequestFailed = 46
HTTP/transport request failed
Unknown = 47
Any unclassified error
Implementations§
Source§impl TransactionErrorCode
impl TransactionErrorCode
Sourcepub fn is_valid(value: i32) -> bool
pub fn is_valid(value: i32) -> bool
Returns true if value is a variant of TransactionErrorCode.
Sourcepub fn from_i32(value: i32) -> Option<TransactionErrorCode>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<TransactionErrorCode>
Converts an i32 to a TransactionErrorCode, or None if value is not a valid variant.
Source§impl TransactionErrorCode
impl TransactionErrorCode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for TransactionErrorCode
impl Clone for TransactionErrorCode
Source§fn clone(&self) -> TransactionErrorCode
fn clone(&self) -> TransactionErrorCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionErrorCode
impl Debug for TransactionErrorCode
Source§impl Default for TransactionErrorCode
impl Default for TransactionErrorCode
Source§fn default() -> TransactionErrorCode
fn default() -> TransactionErrorCode
Source§impl From<TransactionErrorCode> for i32
impl From<TransactionErrorCode> for i32
Source§fn from(value: TransactionErrorCode) -> i32
fn from(value: TransactionErrorCode) -> i32
Source§impl Hash for TransactionErrorCode
impl Hash for TransactionErrorCode
Source§impl Ord for TransactionErrorCode
impl Ord for TransactionErrorCode
Source§fn cmp(&self, other: &TransactionErrorCode) -> Ordering
fn cmp(&self, other: &TransactionErrorCode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TransactionErrorCode
impl PartialEq for TransactionErrorCode
Source§impl PartialOrd for TransactionErrorCode
impl PartialOrd for TransactionErrorCode
Source§impl TryFrom<i32> for TransactionErrorCode
impl TryFrom<i32> for TransactionErrorCode
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<TransactionErrorCode, UnknownEnumValue>
fn try_from(value: i32) -> Result<TransactionErrorCode, UnknownEnumValue>
impl Copy for TransactionErrorCode
impl Eq for TransactionErrorCode
impl StructuralPartialEq for TransactionErrorCode
Auto Trait Implementations§
impl Freeze for TransactionErrorCode
impl RefUnwindSafe for TransactionErrorCode
impl Send for TransactionErrorCode
impl Sync for TransactionErrorCode
impl Unpin for TransactionErrorCode
impl UnwindSafe for TransactionErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request