Enum matrix_sdk::Error
source · #[non_exhaustive]pub enum Error {
Show 26 variants
Http(HttpError),
AuthenticationRequired,
InsufficientData,
BadCryptoStoreState,
NoOlmMachine,
SerdeJson(Error),
Io(Error),
CryptoStoreError(CryptoStoreError),
CrossProcessLockError(LockStoreError),
OlmError(OlmError),
MegolmError(MegolmError),
DecryptorError(DecryptorError),
StateStore(StoreError),
EventCacheStore(EventCacheStoreError),
Identifier(IdParseError),
Url(ParseError),
UserTagName(InvalidUserTagName),
SlidingSync(Error),
WrongRoomState(WrongRoomState),
MultipleSessionCallbacks,
ConcurrentRequestFailed,
UnknownError(Box<dyn Error + Send + Sync>),
EventCache(EventCacheError),
SendQueueWedgeError(QueueWedgeError),
BackupNotEnabled,
Media(MediaError),
}
Expand description
Internal representation of errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(HttpError)
Error doing an HTTP request.
AuthenticationRequired
Queried endpoint requires authentication but was called on an anonymous client.
InsufficientData
This request failed because the local data wasn’t sufficient.
BadCryptoStoreState
Attempting to restore a session after the olm-machine has already been set up fails
NoOlmMachine
Attempting to access the olm-machine but it is not yet available.
SerdeJson(Error)
An error de/serializing type for the StateStore
Io(Error)
An IO error happened.
CryptoStoreError(CryptoStoreError)
An error occurred in the crypto store.
CrossProcessLockError(LockStoreError)
An error occurred with a cross-process store lock.
OlmError(OlmError)
An error occurred during a E2EE operation.
MegolmError(MegolmError)
An error occurred during a E2EE group operation.
DecryptorError(DecryptorError)
An error occurred during decryption.
StateStore(StoreError)
An error occurred in the state store.
EventCacheStore(EventCacheStoreError)
An error occurred in the event cache store.
Identifier(IdParseError)
An error encountered when trying to parse an identifier.
Url(ParseError)
An error encountered when trying to parse a url.
UserTagName(InvalidUserTagName)
An error encountered when trying to parse a user tag name.
SlidingSync(Error)
An error occurred within sliding-sync
WrongRoomState(WrongRoomState)
Attempted to call a method on a room that requires the user to have a specific membership state in the room, but the membership state is different.
MultipleSessionCallbacks
Session callbacks have been set multiple times.
ConcurrentRequestFailed
A concurrent request to a deduplicated request has failed.
UnknownError(Box<dyn Error + Send + Sync>)
An other error was raised.
This might happen because encryption was enabled on the base-crate but not here and that raised.
EventCache(EventCacheError)
An error coming from the event cache subsystem.
SendQueueWedgeError(QueueWedgeError)
An item has been wedged in the send queue.
BackupNotEnabled
Backups are not enabled
Media(MediaError)
An error happened during handling of a media subrequest.
Implementations§
source§impl Error
impl Error
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 Error
impl Error for Error
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 QueueWedgeError
impl From<&Error> for QueueWedgeError
source§impl From<CryptoStoreError> for Error
impl From<CryptoStoreError> for Error
source§fn from(source: CryptoStoreError) -> Self
fn from(source: CryptoStoreError) -> Self
source§impl From<DecryptorError> for Error
impl From<DecryptorError> for Error
source§fn from(source: DecryptorError) -> Self
fn from(source: DecryptorError) -> Self
source§impl From<Error> for Error
impl From<Error> for Error
source§fn from(e: SdkBaseError) -> Self
fn from(e: SdkBaseError) -> Self
source§impl From<Error> for Error
impl From<Error> for Error
source§fn from(e: ReqwestError) -> Self
fn from(e: ReqwestError) -> Self
source§impl From<Error> for RecoveryError
impl From<Error> for RecoveryError
source§impl From<Error> for RequestVerificationError
impl From<Error> for RequestVerificationError
source§impl From<Error> for SecretStorageError
impl From<Error> for SecretStorageError
source§impl From<EventCacheError> for Error
impl From<EventCacheError> for Error
source§fn from(source: EventCacheError) -> Self
fn from(source: EventCacheError) -> Self
source§impl From<EventCacheStoreError> for Error
impl From<EventCacheStoreError> for Error
source§fn from(source: EventCacheStoreError) -> Self
fn from(source: EventCacheStoreError) -> Self
source§impl From<Error> for Error
impl From<Error> for Error
source§fn from(source: IdParseError) -> Self
fn from(source: IdParseError) -> Self
source§impl From<InvalidUserTagName> for Error
impl From<InvalidUserTagName> for Error
source§fn from(source: InvalidUserTagName) -> Self
fn from(source: InvalidUserTagName) -> Self
source§impl From<LockStoreError> for Error
impl From<LockStoreError> for Error
source§fn from(source: LockStoreError) -> Self
fn from(source: LockStoreError) -> Self
source§impl From<MediaError> for Error
impl From<MediaError> for Error
source§fn from(source: MediaError) -> Self
fn from(source: MediaError) -> Self
source§impl From<MegolmError> for Error
impl From<MegolmError> for Error
source§fn from(source: MegolmError) -> Self
fn from(source: MegolmError) -> Self
source§impl From<ParseError> for Error
impl From<ParseError> for Error
source§fn from(source: UrlParseError) -> Self
fn from(source: UrlParseError) -> Self
source§impl From<QueueWedgeError> for Error
impl From<QueueWedgeError> for Error
source§fn from(source: QueueWedgeError) -> Self
fn from(source: QueueWedgeError) -> Self
source§impl From<StoreError> for Error
impl From<StoreError> for Error
source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
source§fn from(e: TryFromIntError) -> Self
fn from(e: TryFromIntError) -> Self
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
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,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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