Enum HttpClientError

Source
pub enum HttpClientError<H: HttpHandler> {
Show 14 variants SerializationBufferFull(usize), Serialization, Utf8Conversion(usize), SendRequest(H::Error), NoStatusCode, ParseHttp(Error), PartialHttpRequest, NoContentHeader, ContentLengthConversion(ParseIntError), DeserializationFailed(Error), MissingStatusField, MissingDataField, FailedAndMissingMessageField, GenericApiError(StatusCode),
}
Expand description

Errors that might get returned by the HttpClient.

Variants§

§

SerializationBufferFull(usize)

Cannot serialize the body because the buffer is full: {0}

§

Serialization

Cannot serialize the body

§

Utf8Conversion(usize)

Cannot convert UTF-8 characters: Valid up to {0}

§

SendRequest(H::Error)

Failed to send HTTPS request

§

NoStatusCode

No status code found in the HTTP response

§

ParseHttp(Error)

Cannot parse the HTTP response: {0:?}

§

PartialHttpRequest

The HTTPS response is only partial

§

NoContentHeader

No content header in response

§

ContentLengthConversion(ParseIntError)

Cannot convert &u8 buffer into a ‘usize’: {0:?}

§

DeserializationFailed(Error)

Cannot deserialize the body into the provided type {0:?}

§

MissingStatusField

Request Might have failed: no “status” field found

§

MissingDataField

Request succeeded but no “data” field found

§

FailedAndMissingMessageField

Request failed and no “message” field found

§

GenericApiError(StatusCode)

Error coming from the Api with message (message stored in HttpClientErrorWrapper)

Trait Implementations§

Source§

impl<H: HttpHandler> Display for HttpClientError<H>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<H: HttpHandler> Format for HttpClientError<H>

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl<'a, H: HttpHandler> From<HttpClientError<H>> for HttpClientErrorWrapper<'a, H>

Source§

fn from(source: HttpClientError<H>) -> Self

Converts to this type from the input type.
Source§

impl<H: HttpHandler> From<HttpClientErrorWrapper<'_, H>> for HttpClientError<H>

Source§

fn from(err: HttpClientErrorWrapper<'_, H>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<H> Freeze for HttpClientError<H>
where <H as HttpHandler>::Error: Freeze,

§

impl<H> RefUnwindSafe for HttpClientError<H>

§

impl<H> Send for HttpClientError<H>
where <H as HttpHandler>::Error: Send,

§

impl<H> Sync for HttpClientError<H>
where <H as HttpHandler>::Error: Sync,

§

impl<H> Unpin for HttpClientError<H>
where <H as HttpHandler>::Error: Unpin,

§

impl<H> UnwindSafe for HttpClientError<H>
where <H as HttpHandler>::Error: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.