pub struct HttpErrorDetail {
pub status: u16,
pub body: String,
pub provider: Option<String>,
pub request_id: Option<String>,
}Expand description
Structured HTTP error detail (status/body/provider/request-id) carried by
ProviderError::HttpError. Re-exported so downstream crates (oxi-agent,
oxi-cli) can construct/inspect structured errors.
Structured HTTP error detail.
omp aligns per-provider error classes — AnthropicApiError carries a
request-id, OpenAIHttpError parses the body envelope, etc. This struct
captures the common structured fields so callers inspect provider/error
identity directly instead of parsing a flat (u16, String) tuple.
Fields§
§status: u16HTTP status code.
body: StringRaw response body.
provider: Option<String>Provider id (e.g. "anthropic", "openai", "deepseek"), if known.
request_id: Option<String>Provider request id (Anthropic request-id, OpenAI x-request-id, …).
Implementations§
Source§impl HttpErrorDetail
impl HttpErrorDetail
Sourcepub fn new(status: u16, body: String) -> Self
pub fn new(status: u16, body: String) -> Self
Minimal detail from a status code and response body.
Sourcepub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
Attach the provider id.
Sourcepub fn with_request_id(self, request_id: Option<String>) -> Self
pub fn with_request_id(self, request_id: Option<String>) -> Self
Attach a provider request id (e.g. parsed from a response header).
Trait Implementations§
Source§impl Clone for HttpErrorDetail
impl Clone for HttpErrorDetail
Source§fn clone(&self) -> HttpErrorDetail
fn clone(&self) -> HttpErrorDetail
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more