Enum matrix_sdk::HttpError
source · [−]pub enum HttpError {
Reqwest(ReqwestError),
AuthenticationRequired,
NotClientRequest,
Api(FromHttpResponseError<RumaApiError>),
IntoHttp(IntoHttpError),
UiaaError(FromHttpResponseError<UiaaError>),
Server(StatusCode),
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(ReqwestError)
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.
UiaaError(FromHttpResponseError<UiaaError>)
An error occurred while authenticating.
When registering or authenticating the Matrix server can send a
UiaaResponse
as the error type, this is a User-Interactive
Authentication API response. This represents an error with
information about how to authenticate the user.
Server(StatusCode)
The server returned a status code that should be retried.
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
sourceimpl HttpError
impl HttpError
sourcepub fn uiaa_response(&self) -> Option<&UiaaInfo>
pub fn 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
sourceimpl Error for HttpError
impl Error for HttpError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
sourceimpl From<Error> for HttpError
impl From<Error> for HttpError
sourcefn from(source: ReqwestError) -> Self
fn from(source: ReqwestError) -> Self
sourceimpl From<HttpError> for ClientBuildError
impl From<HttpError> for ClientBuildError
sourceimpl From<HttpError> for ManualVerifyError
Available on crate feature e2e-encryption
only.
impl From<HttpError> for ManualVerifyError
e2e-encryption
only.