CI / Rustfmt (push) Canceled after 0s
CI / Clippy (push) Canceled after 0s
CI / Test (workspace all features) (push) Canceled after 0s
CI / Test (workspace default features) (push) Canceled after 0s
CI / Test (mytheclipse / bg only) (push) Canceled after 0s
CI / Test (mytheclipse / compute only) (push) Canceled after 0s
CI / Test (mytheclipse / io only) (push) Canceled after 0s
CI / Test (mytheclipse / lifecycle only) (push) Canceled after 0s
CI / Test (mytheclipse / observability only) (push) Canceled after 0s
CI / Test (mytheclipse / resiliency only) (push) Canceled after 0s
CI / Test (mytheclipse / traffic only) (push) Canceled after 0s
CI / Test (mytheclipse-cache / l2-redis) (push) Canceled after 0s
CI / Test (mytheclipse-cache / l1-moka) (push) Canceled after 0s
CI / Test (mytheclipse-cache / default) (push) Canceled after 0s
CI / Test (mytheclipse-config / default) (push) Canceled after 0s
CI / Test (mytheclipse-crypto / default) (push) Canceled after 0s
CI / Test (mytheclipse-event / amqp) (push) Canceled after 0s
CI / Test (mytheclipse-event / nats) (push) Canceled after 0s
CI / Test (mytheclipse-event / default (mem)) (push) Canceled after 0s
CI / Test (mytheclipse-storage / gcs) (push) Canceled after 0s
CI / Test (mytheclipse-storage / s3) (push) Canceled after 0s
CI / Test (mytheclipse-storage / default (local)) (push) Canceled after 0s
CI / Run mytheclipse example (push) Canceled after 0s
CI / Docs check (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse) (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse-cache) (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse-config) (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse-crypto) (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse-event) (push) Canceled after 0s
CI / Cargo package dry-run (mytheclipse-storage) (push) Canceled after 0s
Release / Semantic Release (push) Canceled after 0s
57 lines
1.9 KiB
Rust
57 lines
1.9 KiB
Rust
//! Errors returned by queue and job operations.
|
|
|
|
/// Errors from queue-level operations (enqueue, dequeue, etc.).
|
|
#[derive(Debug)]
|
|
pub enum QueueError {
|
|
/// A transport or backend connection error.
|
|
Connection(String),
|
|
/// The requested topic/queue does not exist or is unavailable.
|
|
NotFound(String),
|
|
/// A serialization error.
|
|
Serialization(String),
|
|
/// A timeout occurred while waiting for an operation.
|
|
Timeout,
|
|
/// The operation was rejected because of a rate limit.
|
|
RateLimit(String),
|
|
}
|
|
|
|
impl std::fmt::Display for QueueError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
Self::Connection(s) => write!(f, "queue connection error: {s}"),
|
|
Self::NotFound(s) => write!(f, "queue not found: {s}"),
|
|
Self::Serialization(s) => write!(f, "serialization error: {s}"),
|
|
Self::Timeout => write!(f, "queue operation timed out"),
|
|
Self::RateLimit(s) => write!(f, "queue rate limited: {s}"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::error::Error for QueueError {}
|
|
|
|
/// Errors from individual job processing.
|
|
#[derive(Debug)]
|
|
pub enum JobError {
|
|
/// The job could not be acknowledged.
|
|
AckFailed(String),
|
|
/// The job could not be moved to the dead-letter queue.
|
|
DlqFailed(String),
|
|
/// The job exceeded its maximum retry count.
|
|
MaxRetriesExceeded,
|
|
/// The job payload could not be decoded.
|
|
InvalidPayload(String),
|
|
}
|
|
|
|
impl std::fmt::Display for JobError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
Self::AckFailed(s) => write!(f, "ack failed: {s}"),
|
|
Self::DlqFailed(s) => write!(f, "dlq move failed: {s}"),
|
|
Self::MaxRetriesExceeded => write!(f, "max retries exceeded"),
|
|
Self::InvalidPayload(s) => write!(f, "invalid payload: {s}"),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl std::error::Error for JobError {}
|