pub enum Error {
Cluster {
operation: String,
message: String,
code: Option<i32>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Transport {
operation: String,
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Timeout {
operation: String,
},
Conversion(String),
Unsupported {
transport: Transport,
what: &'static str,
},
}Expand description
A failure from either transport.
Variants§
Cluster
The cluster refused the request.
code is the YTsaurus error code where one was reported. Both
transports produce them from the same table, so a caller can match on
them without knowing which wire it is on.
Fields
Transport
The cluster could not be reached, or the connection failed mid-request.
Timeout
The request did not complete inside its deadline.
Conversion(String)
A value or row could not be converted between this interface’s model and the transport’s.
Unsupported
The transport does not implement this, and says so rather than pretending.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this is worth trying again.
Deliberately coarse: a transport failure or a timeout may succeed on a second attempt, and a refusal from the cluster generally will not. A caller that needs the real retry rules should use the transport’s own client, which has them.
Sourcepub fn cluster(
operation: impl Into<String>,
message: impl Into<String>,
code: Option<i32>,
) -> Self
pub fn cluster( operation: impl Into<String>, message: impl Into<String>, code: Option<i32>, ) -> Self
Builds a cluster refusal.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
use the Display impl or to_string()