Enum matrix_sdk::HttpError
source · pub enum HttpError {
Reqwest(Error),
NotClientRequest,
Api(FromHttpResponseError<RumaApiError>),
IntoHttp(IntoHttpError),
RefreshToken(RefreshTokenError),
}
Expand description
An HTTP error, representing either a connection error or an error while converting the raw HTTP response into a Matrix response.
Variants§
Reqwest(Error)
Error at the HTTP layer.
NotClientRequest
Queried endpoint is not meant for clients.
Api(FromHttpResponseError<RumaApiError>)
API response error (deserialization, or a Matrix-specific error).
IntoHttp(IntoHttpError)
Error when creating an API request (e.g. serialization of body/headers/query parameters).
RefreshToken(RefreshTokenError)
Error while refreshing the access token.
Implementations§
source§impl HttpError
impl HttpError
sourcepub fn as_ruma_api_error(&self) -> Option<&RumaApiError>
pub fn as_ruma_api_error(&self) -> Option<&RumaApiError>
sourcepub fn as_client_api_error(&self) -> Option<&Error>
pub fn as_client_api_error(&self) -> Option<&Error>
Shorthand for
.as_ruma_api_error().and_then(RumaApiError::as_client_api_error)
.
source§impl HttpError
impl HttpError
sourcepub fn client_api_error_kind(&self) -> Option<&ErrorKind>
pub fn client_api_error_kind(&self) -> Option<&ErrorKind>
If self
is a server error in the errcode
+ error
format expected
for client-API endpoints, returns the error kind (errcode
).
sourcepub fn as_uiaa_response(&self) -> Option<&UiaaInfo>
pub fn as_uiaa_response(&self) -> Option<&UiaaInfo>
Try to destructure the error into an universal interactive auth info.
Some requests require universal interactive auth, doing such a request will always fail the first time with a 401 status code, the response body will contain info how the client can authenticate.
The request will need to be retried, this time containing additional authentication data.
This method is an convenience method to get to the info the server returned on the first, failed request.
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
source§impl From<Error> for HttpError
impl From<Error> for HttpError
source§fn from(source: ReqwestError) -> Self
fn from(source: ReqwestError) -> Self
source§impl From<FromHttpResponseError<Error>> for HttpError
impl From<FromHttpResponseError<Error>> for HttpError
source§fn from(err: FromHttpResponseError<Error>) -> Self
fn from(err: FromHttpResponseError<Error>) -> Self
source§impl From<FromHttpResponseError<MatrixError>> for HttpError
impl From<FromHttpResponseError<MatrixError>> for HttpError
source§fn from(err: FromHttpResponseError<MatrixError>) -> Self
fn from(err: FromHttpResponseError<MatrixError>) -> Self
source§impl From<FromHttpResponseError<RumaApiError>> for HttpError
impl From<FromHttpResponseError<RumaApiError>> for HttpError
source§fn from(source: FromHttpResponseError<RumaApiError>) -> Self
fn from(source: FromHttpResponseError<RumaApiError>) -> Self
source§impl From<FromHttpResponseError<UiaaResponse>> for HttpError
impl From<FromHttpResponseError<UiaaResponse>> for HttpError
source§fn from(err: FromHttpResponseError<UiaaResponse>) -> Self
fn from(err: FromHttpResponseError<UiaaResponse>) -> Self
source§impl From<HttpError> for ClientBuildError
impl From<HttpError> for ClientBuildError
source§impl From<HttpError> for ManualVerifyError
Available on crate feature e2e-encryption
only.
impl From<HttpError> for ManualVerifyError
e2e-encryption
only.Auto Trait Implementations§
impl !Freeze for HttpError
impl !RefUnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl !UnwindSafe 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
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more