1use thiserror::Error;
4
5pub type QueueResult<T> = Result<T, QueueError>;
7
8#[derive(Debug, Error)]
10pub enum QueueError {
11 #[error("Redis error: {0}")]
13 Redis(#[from] redis::RedisError),
14
15 #[error("Serialization error: {0}")]
17 Serialization(String),
18
19 #[error("Deserialization error: {0}")]
21 Deserialization(String),
22
23 #[error("Job not found: {0}")]
25 JobNotFound(String),
26
27 #[error("Job execution failed: {0}")]
29 ExecutionFailed(String),
30
31 #[error("No handler registered for job type: {0}")]
33 NoHandler(String),
34
35 #[error("Worker not running")]
37 WorkerNotRunning,
38
39 #[error("Worker already running")]
41 WorkerAlreadyRunning,
42
43 #[error("Queue is full")]
45 QueueFull,
46
47 #[error("Configuration error: {0}")]
49 Config(String),
50
51 #[error("Operation timeout")]
53 Timeout,
54
55 #[error("Queue error: {0}")]
57 Other(String),
58}