#[non_exhaustive]pub enum ClientError {
Show 18 variants
Policy(PolicyError),
Model(ModelError),
Json(String),
Transport(String),
TooLarge,
TooManyRedirects,
BadRedirect,
Timeout,
AuthenticationRequired,
Forbidden,
#[non_exhaustive] Api {
status: u16,
tea_error: Option<String>,
message: Option<String>,
},
#[non_exhaustive] Unresolved {
error: String,
message: Option<String>,
},
#[non_exhaustive] DiscoveryFailed {
stage: &'static str,
attempts: u32,
},
#[non_exhaustive] Integrity {
outcome: IntegrityOutcome,
report: IntegrityReport,
},
Io(String),
#[non_exhaustive] Throttled {
status: u16,
retry_after_secs: Option<u64>,
},
Offline,
#[non_exhaustive] Token {
error: String,
},
}Expand description
Failure of a consumer HTTP operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Policy(PolicyError)
The URL was rejected by destination policy.
Model(ModelError)
A TEA document or identifier was not valid.
Json(String)
JSON that could not be decoded.
Transport(String)
A connection or protocol failure.
TooLarge
A response exceeded a configured limit.
TooManyRedirects
Redirects exceeded the configured limit.
BadRedirect
A redirect had no usable Location.
Timeout
The request timed out.
AuthenticationRequired
The server required authentication and no credential was available for that origin.
Forbidden
The server returned 403. This does not trigger token replacement or failover.
#[non_exhaustive]Api
An HTTP status the operation did not accept.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Unresolved
/discovery returned a TEA 404. This is not evidence that no updates exist.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]DiscoveryFailed
Well-known or API discovery attempts were exhausted.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]Integrity
Declared checksums did not all match the decoded artifact bytes, or at least one could not be computed.
Fields
This variant is marked as non-exhaustive
outcome: IntegrityOutcomeSummary outcome.
report: IntegrityReportPer-algorithm detail.
Io(String)
A local file operation of a streaming download failed (for example the destination exists, is a symbolic link, or could not be written). Experimental. The text names the operation and the I/O error kind.
#[non_exhaustive]Throttled
The server answered a GET with 429 or 503 and the retries (which
honor Retry-After up to crate::Limits::max_retry_after) ran out, or
the server asked for a longer wait than that limit allows.
Fields
This variant is marked as non-exhaustive
Offline
Offline mode: the response is not in the cache (or is too old), or the request cannot be served from a cache at all.
#[non_exhaustive]Token
The token endpoint rejected the credential exchange.
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
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()