Enum matrix_sdk::HttpError
source · pub enum HttpError {
Reqwest(Error),
AuthenticationRequired,
NotClientRequest,
Api(FromHttpResponseError<RumaApiError>),
IntoHttp(IntoHttpError),
UnableToCloneRequest,
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)
An error at the HTTP layer.
AuthenticationRequired
Queried endpoint requires authentication but was called on an anonymous client.
NotClientRequest
Queried endpoint is not meant for clients.
Api(FromHttpResponseError<RumaApiError>)
An error converting between ruma_*_api types and Hyper types.
IntoHttp(IntoHttpError)
An error converting between ruma_client_api types and Hyper types.
UnableToCloneRequest
The given request can’t be cloned and thus can’t be retried.
RefreshToken(RefreshTokenError)
An error occurred 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)
.
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<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.