use thiserror::Error;
pub type QueueResult<T> = Result<T, QueueError>;
#[derive(Debug, Error)]
pub enum QueueError {
#[error("Redis error: {0}")]
Redis(#[from] redis::RedisError),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Deserialization error: {0}")]
Deserialization(String),
#[error("Job not found: {0}")]
JobNotFound(String),
#[error("Job execution failed: {0}")]
ExecutionFailed(String),
#[error("No handler registered for job type: {0}")]
NoHandler(String),
#[error("Worker not running")]
WorkerNotRunning,
#[error("Worker already running")]
WorkerAlreadyRunning,
#[error("Queue is full")]
QueueFull,
#[error("Configuration error: {0}")]
Config(String),
#[error("Operation timeout")]
Timeout,
#[error("Queue error: {0}")]
Other(String),
}