Enum matrix_sdk::HttpError
source · [−]pub enum HttpError {
Reqwest(ReqwestError),
AuthenticationRequired,
NotClientRequest,
Api(FromHttpResponseError<RumaApiError>),
IntoHttp(IntoHttpError),
UiaaError(FromHttpResponseError<UiaaError>),
Server(StatusCode),
UnableToCloneRequest,
UserIdRequired,
}
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.
UserIdRequired
Tried to send a request without user_id
in the Session
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)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<Error> for HttpError
impl From<Error> for HttpError
sourcefn from(source: ReqwestError) -> Self
fn from(source: ReqwestError) -> Self
Converts to this type from the input type.
sourceimpl From<HttpError> for ClientBuildError
impl From<HttpError> for ClientBuildError
sourceimpl From<HttpError> for ManualVerifyError
impl From<HttpError> for ManualVerifyError
Auto Trait Implementations
impl !RefUnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl !UnwindSafe for HttpError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more