#[non_exhaustive]pub enum ClientError {
ConfigIo(String),
ConfigDecode(String),
MissingConfigField {
field: &'static str,
},
ConfigValidation {
field: &'static str,
reason: String,
},
InvalidNamespacePath(String),
InvalidCommitId(String),
InvalidCheckpointId(String),
Http(String),
Api {
status: u16,
code: String,
feature: Option<String>,
message: String,
request_id: Option<String>,
details: Option<Box<ErrorDetails>>,
},
Io(String),
Json(String),
}Expand description
Error returned by the blocking HTTP client.
Foreign causes (io, json, ureq) are captured as message strings rather
than #[source] chains.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConfigIo(String)
ConfigDecode(String)
MissingConfigField
ConfigValidation
InvalidNamespacePath(String)
InvalidCommitId(String)
InvalidCheckpointId(String)
Http(String)
Api
Fields
details: Option<Box<ErrorDetails>>Structured context for the code, when the server sent any. Boxed so the rare detailed error does not widen every client result.
Io(String)
Json(String)
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn code(&self) -> Option<ErrorCode>
pub fn code(&self) -> Option<ErrorCode>
Returns the typed code for ClientError::Api errors, or None for
non-API errors and for codes this build does not know (clients must
tolerate unknown codes).
Sourcepub fn kind(&self) -> Option<ErrorKind>
pub fn kind(&self) -> Option<ErrorKind>
Returns the caller-action category for ClientError::Api errors.
Known codes classify through ErrorCode::kind. Unknown codes (a
newer server) fall back to the HTTP status class, so retry decisions
still work: 503 is ErrorKind::Unavailable, other 5xx are
ErrorKind::Internal, and 4xx are ErrorKind::InvalidRequest.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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
use the Display impl or to_string()