1use thiserror::Error;
2use thiserror_ext::{Box, Construct};
3
4#[derive(Error, Debug, Box, Construct)]
6#[thiserror_ext(newtype(name = Error))]
7pub enum ErrorKind {
8 #[error("At least one endpoint must be defined")]
10 MissingEndpoint,
11
12 #[error("At least one interface must be defined")]
14 MissingInterface,
15
16 #[error("Invalid Interface Configuration: {0}")]
18 InvalidInterfaceConfiguration(String),
19
20 #[error("Invalid Endpoint Configuration: {0}")]
22 InvalidEndpointConfiguration(String),
23
24 #[error("Room identifiers must start with # or !")]
26 InvalidMatrixRoomIdentifier,
27
28 #[error("Invalid port number, valid u16 value expected and got {0}")]
30 InvalidPortNumber(i64),
31
32 #[error("Interface feature {0} is not enabled")]
34 DisabledInterfaceFeature(String),
35
36 #[error("Endpoint feature {0} is not enabled")]
38 DisabledEndpointFeature(String),
39
40 #[error("std::io Error: {0}")]
43 IOError(#[from] std::io::Error),
44
45 #[error("Serde_json Error: {0}")]
47 SerdeJsonError(#[from] serde_json::Error),
48
49 #[cfg(feature = "parse-cfg")]
50 #[error("Serde Toml Error: {0}")]
52 SerdeTomlError(#[from] toml::de::Error),
53
54 #[cfg(feature = "matrix")]
55 #[error("Matrix_SDK Error: {0}")]
57 MatrixSDKError(#[from] matrix_sdk::Error),
58
59 #[cfg(feature = "matrix")]
60 #[error("Matrix ClientBuild Error: {0}")]
62 MatrixClientBuildError(#[from] matrix_sdk::ClientBuildError),
63
64 #[cfg(feature = "matrix")]
65 #[error("Matrix SecretStorage Error: {0}")]
67 MatrixSecretStoreError(#[from] matrix_sdk::encryption::secret_storage::SecretStorageError),
68
69 #[cfg(feature = "matrix")]
70 #[error("Matrix RecoveryError Error: {0}")]
72 MatrixRecoveryError(#[from] matrix_sdk::encryption::recovery::RecoveryError),
73
74 #[cfg(all(unix, any(feature = "pipe-client", feature = "pipe-server", feature = "pipe")))]
75 #[error("Nix ErrorNo Error: {0}")]
77 NixErrorNoError(#[from] nix::errno::Errno),
78
79 #[cfg(any(feature = "http-client", feature = "http-server"))]
80 #[error("Url Parse Error: {0}")]
82 UrlParseError(#[from] url::ParseError),
83
84 #[cfg(feature = "email")]
85 #[error("Mail Send Error: {0}")]
87 MailSendError(#[from] mail_send::Error),
88}