#[non_exhaustive]pub enum ProviderError {
Transport(TransportError),
InvalidRequest(String),
Serialize(Error),
Deserialize {
source: Error,
body: String,
},
}Expand description
Generic error type for OpenAI-compatible API provider clients.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transport(TransportError)
Transport-layer error from the shared HTTP/SSE layer.
This is also where streaming/chunk deserialization failures land: an SSE
event that fails to parse originates as TransportError::Deserialize and
is wrapped here, not as the Deserialize variant
below, which is reserved for full response-body failures from parse_json.
InvalidRequest(String)
The request shape was invalid for the selected client method.
Serialize(Error)
Failed to serialize the request body.
Deserialize
Failed to deserialize a full response body.
Produced only by parse_json, which deserializes the entire HTTP response
body. Streaming/chunk deserialization failures are a separate concern: they
originate as TransportError::Deserialize and surface on
Transport (via From<TransportError>), not here.
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
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()