pub enum OxiHttpError {
Show 17 variants
InvalidUri(Arc<InvalidUri>),
Http(Arc<Error>),
Hyper(String),
Io(Arc<Error>),
Body(String),
Timeout(String),
Redirect(String),
Tls(String),
Dns(String),
ConnectionPool(String),
Json(String),
FormEncoding(String),
InvalidHeader(String),
Server(String),
RouteNotFound {
method: String,
path: String,
},
MethodNotAllowed {
method: String,
path: String,
},
H3(String),
}Expand description
Top-level error type for the OxiHTTP stack.
Variants§
InvalidUri(Arc<InvalidUri>)
An invalid URI was provided.
Http(Arc<Error>)
An HTTP protocol error.
Hyper(String)
A hyper transport error, captured as a string to avoid exposing hyper’s types.
Io(Arc<Error>)
An I/O error.
Body(String)
An error reading or processing the response body.
Timeout(String)
A request or connect timeout expired.
Redirect(String)
A redirect loop or limit was reached.
Tls(String)
A TLS-specific error from oxitls.
Dns(String)
A DNS resolution failure.
ConnectionPool(String)
Connection pool exhaustion.
Json(String)
JSON serialization/deserialization error.
FormEncoding(String)
URL-encoded form error.
InvalidHeader(String)
An invalid header name or value.
Server(String)
A server-specific error.
RouteNotFound
Route not found (404).
MethodNotAllowed
Method not allowed (405).
Fields
H3(String)
An HTTP/3 / QUIC transport error (oxiquic-h3).
Implementations§
Source§impl OxiHttpError
impl OxiHttpError
Sourcepub fn status_code(&self) -> Option<StatusCode>
pub fn status_code(&self) -> Option<StatusCode>
Returns the HTTP status code associated with this error, if any.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if this is a timeout error.
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Returns true if this is a connection-related error.
Sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
Returns true if this is a redirect error.
Trait Implementations§
Source§impl Clone for OxiHttpError
impl Clone for OxiHttpError
Source§fn clone(&self) -> OxiHttpError
fn clone(&self) -> OxiHttpError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OxiHttpError
impl Debug for OxiHttpError
Source§impl Display for OxiHttpError
impl Display for OxiHttpError
Source§impl Error for OxiHttpError
impl Error for OxiHttpError
1.30.0 · 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()