#[non_exhaustive]pub enum TransportError {
InvalidConfig(&'static str),
BuildClient(Error),
Transport(Error),
HttpStatus {
status: StatusCode,
body: String,
},
Deserialize {
source: Error,
body: String,
},
Utf8(FromUtf8Error),
BodyTooLarge {
limit: usize,
},
InvalidResponse(String),
}Expand description
Errors produced by the shared HTTP/SSE transport layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConfig(&'static str)
BuildClient(Error)
Transport(Error)
HttpStatus
A non-success HTTP status, with the full response body captured as diagnostic text.
body is read under the shared size cap (MAX_BODY_BYTES). Bodies that fit are captured
in full; an oversized error body instead surfaces as BodyTooLarge
and this variant is not produced. So when this variant is present, body is complete —
never a truncated prefix.
Deserialize
A streamed response chunk could not be deserialized.
Produced only by the SSE event parser, one event at a time. When a
TransportError is lifted into a ProviderError via From,
this surfaces as ProviderError::Transport(TransportError::Deserialize) —
not as ProviderError::Deserialize, which is reserved for full-body
failures produced by parse_json. Consumers matching for deserialization
failures across both paths must account for both variants.
Utf8(FromUtf8Error)
BodyTooLarge
A non-streaming response body exceeded the shared size cap and was not fully buffered.
Produced by the capped body reader (read_body_text). Distinct from
InvalidResponse, which reports content problems (empty body,
malformed structure) rather than a size limit. The reader stops before the offending chunk
is appended, so no body text is carried here. When the overflow occurs while reading an
error body, the HTTP status is not carried here either — it is visible only to callers
that read status off the raw response before consuming the body (the prepare/send path).
InvalidResponse(String)
Trait Implementations§
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
Source§impl Error for TransportError
impl Error for TransportError
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()