matrix_sdk/sliding_sync/
error.rs1use matrix_sdk_common::executor::JoinError;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
8#[non_exhaustive]
9pub enum Error {
10 #[error("Sliding sync version is missing")]
13 VersionIsMissing,
14
15 #[error("The sliding sync response could not be handled: {0}")]
19 BadResponse(String),
20
21 #[error(
25 "The sliding sync list `{0}` is handling a response, \
26 but its request generator has not been initialized"
27 )]
28 RequestGeneratorHasNotBeenInitialized(String),
29
30 #[error("Ranges have invalid bounds: `{start}..{end}`")]
32 InvalidRange {
33 start: u32,
35 end: u32,
37 },
38
39 #[error("Unauthenticated user in sliding sync")]
41 UnauthenticatedUser,
42
43 #[error("SlidingSync's internal channel is broken")]
45 InternalChannelIsBroken,
46
47 #[error("The Sliding Sync instance's identifier must be less than 16 chars long")]
49 InvalidSlidingSyncIdentifier,
50
51 #[error(
53 "A task failed to execute to completion; \
54 task description: {task_description}, error: {error}"
55 )]
56 JoinError {
57 task_description: String,
59 error: JoinError,
61 },
62
63 #[cfg(feature = "e2e-encryption")]
65 #[error("The Olm machine is missing")]
66 NoOlmMachine,
67
68 #[cfg(feature = "e2e-encryption")]
70 #[error(transparent)]
71 CryptoStoreError(#[from] matrix_sdk_base::crypto::CryptoStoreError),
72}