1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum RedisError {
8 #[error("Connection failed: {0}")]
9 Connection(String),
10
11 #[error("Protocol error: {0}")]
12 Protocol(String),
13
14 #[error("IO error: {0}")]
15 Io(#[from] std::io::Error),
16
17 #[error("Redis error: {0}")]
18 Redis(String),
19
20 #[error("Timeout")]
21 Timeout,
22
23 #[error("Pool exhausted")]
24 PoolExhausted,
25
26 #[error("Invalid response: {0}")]
27 InvalidResponse(String),
28
29 #[error("Pool error: {0}")]
30 Pool(String),
31
32 #[error("Incomplete data")]
33 Incomplete,
34}
35
36pub type RedisResult<T> = Result<T, RedisError>;