1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, SynapError>;
7
8#[derive(Error, Debug)]
10pub enum SynapError {
11 #[error("HTTP error: {0}")]
13 HttpError(#[from] reqwest::Error),
14
15 #[error("JSON error: {0}")]
17 JsonError(#[from] serde_json::Error),
18
19 #[error("Invalid URL: {0}")]
21 InvalidUrl(#[from] url::ParseError),
22
23 #[error("Server error: {0}")]
25 ServerError(String),
26
27 #[error("Key not found: {0}")]
29 KeyNotFound(String),
30
31 #[error("Queue not found: {0}")]
33 QueueNotFound(String),
34
35 #[error("Stream room not found: {0}")]
37 RoomNotFound(String),
38
39 #[error("Invalid response: {0}")]
41 InvalidResponse(String),
42
43 #[error("Operation timeout")]
45 Timeout,
46
47 #[error("{0}")]
49 Other(String),
50}