pub enum SolanaProviderError {
NetworkError(String),
RpcError(String),
RequestError {
error: String,
status_code: u16,
},
InvalidAddress(String),
SelectorError(RpcSelectorError),
NetworkConfiguration(String),
InsufficientFunds(String),
BlockhashNotFound(String),
InvalidTransaction(String),
AlreadyProcessed(String),
}Expand description
Errors that can occur when interacting with the Solana provider.
Use is_transient() to determine if an error should be retried.
Variants§
NetworkError(String)
Network/IO error (transient - connection issues, timeouts)
RpcError(String)
RPC protocol error (transient - RPC-level issues like node lag, sync pending)
RequestError
HTTP request error with status code (transient/permanent based on status code)
InvalidAddress(String)
Invalid address format (permanent)
SelectorError(RpcSelectorError)
RPC selector error (transient - can retry with different node)
NetworkConfiguration(String)
Network configuration error (permanent - missing data, unsupported operations)
InsufficientFunds(String)
Insufficient funds for transaction (permanent)
BlockhashNotFound(String)
Blockhash not found or expired (transient - can rebuild with fresh blockhash)
InvalidTransaction(String)
Invalid transaction structure or execution (permanent)
AlreadyProcessed(String)
Transaction already processed (permanent - duplicate)
Implementations§
Source§impl SolanaProviderError
impl SolanaProviderError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Determines if this error is transient (can retry) or permanent (should fail).
With comprehensive error code classification in from_rpc_response_error(),
errors are properly categorized at the source, so we can simply match on variants.
Transient (can retry):
NetworkError: IO/connection errors, timeouts, network unavailableRpcError: RPC protocol issues, node lag, sync pending (-32004, -32005, -32014, -32016)BlockhashNotFound: Can rebuild transaction with fresh blockhash (-32008)SelectorError: Can retry with different RPC nodeRequestError: HTTP errors with retriable status codes (5xx, 408, 425, 429)
Permanent (fail immediately):
InsufficientFunds: Not enough balance for transactionInvalidTransaction: Malformed transaction, invalid signatures, version mismatch (-32002, -32003, -32013, -32015, -32602)AlreadyProcessed: Duplicate transaction already on-chain (-32009)InvalidAddress: Invalid public key formatNetworkConfiguration: Missing data, unsupported operations (-32007, -32010)RequestError: HTTP errors with non-retriable status codes (4xx except 408, 425, 429)
Sourcepub fn from_rpc_error(error: ClientError) -> Self
pub fn from_rpc_error(error: ClientError) -> Self
Classifies a Solana RPC client error into the appropriate error variant.
Uses structured error types from the Solana SDK for precise classification, including JSON-RPC error codes for enhanced accuracy.
Trait Implementations§
Source§impl Debug for SolanaProviderError
impl Debug for SolanaProviderError
Source§impl Display for SolanaProviderError
impl Display for SolanaProviderError
Source§impl Error for SolanaProviderError
impl Error for SolanaProviderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<SolanaProviderError> for ProviderError
impl From<SolanaProviderError> for ProviderError
Source§fn from(source: SolanaProviderError) -> Self
fn from(source: SolanaProviderError) -> Self
Source§impl From<SolanaProviderError> for RelayerError
impl From<SolanaProviderError> for RelayerError
Source§fn from(source: SolanaProviderError) -> Self
fn from(source: SolanaProviderError) -> Self
Source§impl From<SolanaProviderError> for SolanaRpcError
impl From<SolanaProviderError> for SolanaRpcError
Source§fn from(source: SolanaProviderError) -> Self
fn from(source: SolanaProviderError) -> Self
Source§impl From<SolanaProviderError> for SolanaTransactionValidationError
impl From<SolanaProviderError> for SolanaTransactionValidationError
Source§fn from(source: SolanaProviderError) -> Self
fn from(source: SolanaProviderError) -> Self
Source§impl From<SolanaProviderError> for TransactionError
impl From<SolanaProviderError> for TransactionError
Source§fn from(source: SolanaProviderError) -> Self
fn from(source: SolanaProviderError) -> Self
Source§impl From<String> for SolanaProviderError
impl From<String> for SolanaProviderError
Auto Trait Implementations§
impl Freeze for SolanaProviderError
impl RefUnwindSafe for SolanaProviderError
impl Send for SolanaProviderError
impl Sync for SolanaProviderError
impl Unpin for SolanaProviderError
impl UnwindSafe for SolanaProviderError
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
§impl<T> Encode for T
impl<T> Encode for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
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>
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>
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 more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SectionExt for T
impl<T> SectionExt for T
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.