yarli_cli/yarli-queue/src/
error.rs1use thiserror::Error;
4use uuid::Uuid;
5
6#[derive(Debug, Error)]
8pub enum QueueError {
9 #[error("queue entry not found: {0}")]
11 NotFound(Uuid),
12
13 #[error("invalid status for {entry_id}: expected {expected}, got {actual}")]
15 InvalidStatus {
16 entry_id: Uuid,
17 expected: &'static str,
18 actual: String,
19 },
20
21 #[error("lease expired for entry {0}")]
23 LeaseExpired(Uuid),
24
25 #[error("lease owner mismatch for entry {entry_id}: expected {expected}, got {actual}")]
27 LeaseOwnerMismatch {
28 entry_id: Uuid,
29 expected: String,
30 actual: String,
31 },
32
33 #[error("duplicate task in queue: task_id={0}")]
35 DuplicateTask(Uuid),
36
37 #[error("concurrency cap exceeded: {0}")]
39 ConcurrencyCapExceeded(String),
40
41 #[error("database error: {0}")]
43 Database(String),
44
45 #[error("runtime error: {0}")]
47 Runtime(String),
48
49 #[error("invalid queue status in store: {0}")]
51 InvalidQueueStatus(String),
52
53 #[error("invalid command class in store: {0}")]
55 InvalidCommandClass(String),
56}