pub enum HttpError {
DeserializationError(Error<Error>),
BadStatus {
code: StatusCode,
body: Value,
},
StreamError(Error),
RequestError(Error),
StreamingRequestError(CannotCloneRequestError),
HttpError(Error),
ApiError(ResponseError),
WsConnect(Error),
NotifySerialize(Error),
NotifySend(Error),
NotifyChannelClosed,
NotifyRejected {
code: u16,
message: Value,
},
}Expand description
Errors that can occur during HTTP operations.
Variants§
DeserializationError(Error<Error>)
Failed to deserialize the response body.
Includes path information to help identify which field caused the error.
BadStatus
The server returned a non-success HTTP status code.
Fields
code: StatusCodeThe HTTP status code (e.g., 400, 401, 500).
StreamError(Error)
Error occurred while reading from an SSE stream.
RequestError(Error)
Failed to build the HTTP request.
StreamingRequestError(CannotCloneRequestError)
Failed to establish a streaming connection.
Occurs when the request cannot be cloned for SSE retry logic.
HttpError(Error)
General HTTP transport error (network, timeout, etc.).
ApiError(ResponseError)
The API returned a structured error response.
WsConnect(Error)
Failed to upgrade the request to a WebSocket. Used by the
send_streaming_ws path before any frames have flowed.
NotifySerialize(Error)
Failed to serialize the notify request body to JSON.
NotifySend(Error)
Failed to write the notify frame to the WebSocket sink.
NotifyChannelClosed
The WebSocket closed before the matching client_response
arrived. Either the server hung up or the demux task exited.
NotifyRejected
The server replied to a notify with client_response::Error.
The most common cause is the notify’s response_id not
matching any agent completion this WS produced.
Trait Implementations§
Source§impl Error for HttpError
impl Error for HttpError
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()
Source§impl From<CannotCloneRequestError> for HttpError
impl From<CannotCloneRequestError> for HttpError
Source§fn from(source: CannotCloneRequestError) -> Self
fn from(source: CannotCloneRequestError) -> Self
Source§impl From<ResponseError> for HttpError
impl From<ResponseError> for HttpError
Source§fn from(source: ResponseError) -> Self
fn from(source: ResponseError) -> Self
Auto Trait Implementations§
impl !Freeze for HttpError
impl !RefUnwindSafe for HttpError
impl !UnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl UnsafeUnpin for HttpError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.