armature_queue/
error.rs

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