1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum Error {
6 #[error("At least one endpoint must be defined")]
8 MissingEndpoint,
9
10 #[error("At least one interface must be defined")]
12 MissingInterface,
13
14 #[error("Invalid Interface Configuration: {0}")]
16 InvalidInterfaceConfiguration(String),
17
18 #[error("Invalid Endpoint Configuration: {0}")]
20 InvalidEndpointConfiguration(String),
21
22 #[error("Room identifiers must start with # or !")]
24 InvalidMatrixRoomIdentifier,
25
26 #[error("Invalid port number, valid u16 value expected and got {0}")]
28 InvalidPortNumber(i64),
29
30 #[error("Interface feature {0} is not enabled")]
32 DisabledInterfaceFeature(String),
33
34 #[error("Endpoint feature {0} is not enabled")]
36 DisabledIEndpointFeature(String),
37
38 #[error("std::io Error: {0}")]
41 IOError(#[from] std::io::Error),
42
43 #[error("Serde_json Error: {0}")]
45 SerdeJsonError(#[from] serde_json::Error),
46
47 #[cfg(feature = "parse-cfg")]
48 #[error("Serde Toml Error: {0}")]
50 SerdeTomlError(#[from] toml::de::Error),
51
52 #[cfg(feature = "matrix")]
53 #[error("Matrix_SDK Error: {0}")]
55 MatrixSDKError(#[from] matrix_sdk::Error),
56
57 #[cfg(feature = "matrix")]
58 #[error("Matrix ClientBuild Error: {0}")]
60 MatrixClientBuildError(#[from] matrix_sdk::ClientBuildError),
61
62 #[cfg(feature = "matrix")]
63 #[error("Matrix SecretStorage Error: {0}")]
65 MatrixSecretStoreError(#[from] matrix_sdk::encryption::secret_storage::SecretStorageError),
66
67 #[cfg(feature = "matrix")]
68 #[error("Matrix RecoveryError Error: {0}")]
70 MatrixRecoveryError(#[from] matrix_sdk::encryption::recovery::RecoveryError),
71
72 #[cfg(all(unix, any(feature = "pipe-client", feature = "pipe-server", feature = "pipe")))]
73 #[error("Nix ErrorNo Error: {0}")]
75 NixErrorNoError(#[from] nix::errno::Errno),
76
77 #[cfg(any(feature = "http-client", feature = "http-server"))]
78 #[error("Url Parse Error: {0}")]
80 UrlParseError(#[from] url::ParseError),
81
82 #[cfg(feature = "email")]
83 #[error("Mail Send Error: {0}")]
85 MailSendError(#[from] mail_send::Error),
86}