hedged_rpc_client/errors.rs
1use std::time::Duration;
2
3use solana_client::client_error::ClientError;
4
5use crate::config::ProviderId;
6
7/// Errors that can occur during hedged RPC operations.
8#[derive(thiserror::Error, Debug)]
9pub enum HedgedError {
10 /// No RPC providers were configured.
11 #[error("no providers configured")]
12 NoProviders,
13
14 /// All configured providers returned errors.
15 ///
16 /// Contains the list of providers and their individual errors.
17 #[error("all providers failed: {0:?}")]
18 AllFailed(Vec<(ProviderId, ClientError)>),
19
20 /// The hedged request exceeded the configured timeout.
21 ///
22 /// None of the providers responded successfully within the time limit.
23 #[error("hedged call timed out after {0:?}")]
24 Timeout(Duration),
25}