pub enum RestError {
Transport(ModelError),
Headers(Box<dyn Error + Send + Sync>),
ResponseHeaderTimeout,
DeadlineExceeded,
DroppedBody {
parts: Box<Parts>,
source: ModelError,
},
}Expand description
Why RestTransport::send failed, or (boxed in
ModelError::Other) why a streaming body under a deadline ended.
Display carries no provider prefix: the transport’s own texts
(net/http: timeout awaiting response headers, context deadline exceeded), else the
cause’s Display (a ModelError’s, e.g. transport error: …). Each provider maps the
variants to its own error type and text instead of using this Display.
Variants§
Transport(ModelError)
The last attempt received no response: HttpClient::send
failed (connection error, invalid request, …). The cause is kept as it is so the
provider can classify it and strip URLs.
Headers(Box<dyn Error + Send + Sync>)
The last attempt’s RequestHeaders::headers failed
(for example a credential fetch); the provider’s own error, boxed.
ResponseHeaderTimeout
The last attempt’s response headers did not arrive within the transport’s
response_header_timeout.
DeadlineExceeded
The call’s deadline passed: the last attempt’s
CallTimeout::PerAttempt deadline, or the
CallTimeout::Call deadline at any point of the call.
DroppedBody
The final response’s body failed while being read (the body of every status ≥ 400,
and of a non-streaming 2xx); parts is that response’s head, source the body error.
Fields
source: ModelErrorThe body stream’s error.
Trait Implementations§
Source§impl Error for RestError
impl Error for RestError
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()