#[non_exhaustive]pub enum Error {
Show 28 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),
QrCodeScanError(ScanError),
UserTagName(InvalidUserTagName),
SlidingSync(Error),
WrongRoomState(WrongRoomState),
MultipleSessionCallbacks,
Oidc(OidcError),
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
e2e-encryption
only.Attempting to restore a session after the olm-machine has already been set up fails
NoOlmMachine
e2e-encryption
only.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)
e2e-encryption
only.An error occurred in the crypto store.
CrossProcessLockError(LockStoreError)
An error occurred with a cross-process store lock.
OlmError(OlmError)
e2e-encryption
only.An error occurred during a E2EE operation.
MegolmError(MegolmError)
e2e-encryption
only.An error occurred during a E2EE group operation.
DecryptorError(DecryptorError)
e2e-encryption
only.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.
QrCodeScanError(ScanError)
qrcode
only.An error while scanning a QR code.
UserTagName(InvalidUserTagName)
An error encountered when trying to parse a user tag name.
SlidingSync(Error)
experimental-sliding-sync
only.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.
Oidc(OidcError)
experimental-oidc
only.An error occurred interacting with the OpenID Connect API.
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
Available on crate feature e2e-encryption
only.
impl From<Error> for RecoveryError
e2e-encryption
only.Source§impl From<Error> for RequestVerificationError
Available on crate feature e2e-encryption
only.
impl From<Error> for RequestVerificationError
e2e-encryption
only.Source§impl From<Error> for SecretStorageError
Available on crate feature e2e-encryption
only.
impl From<Error> for SecretStorageError
e2e-encryption
only.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
§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