appletheia_application/outbox/
outbox_error.rs1use thiserror::Error;
2
3use super::{OutboxAttemptCountError, OutboxLifecycle, OutboxState};
4
5#[derive(Debug, Error)]
6pub enum OutboxError {
7 #[error("outbox attempt count error: {0}")]
8 AttemptCount(#[from] OutboxAttemptCountError),
9
10 #[error("cannot acknowledge a dead-lettered outbox in lifecycle {0:?}")]
11 AckOnDeadLettered(OutboxLifecycle),
12
13 #[error("cannot negatively acknowledge a dead-lettered outbox in lifecycle {0:?}")]
14 NackOnDeadLettered(OutboxLifecycle),
15
16 #[error("cannot extend lease for a dead-lettered outbox in lifecycle {0:?}")]
17 ExtendLeaseOnDeadLettered(OutboxLifecycle),
18
19 #[error("cannot acquire lease for a dead-lettered outbox in lifecycle {0:?}")]
20 AcquireLeaseOnDeadLettered(OutboxLifecycle),
21
22 #[error("extend_lease is only valid in leased state, got {0:?}")]
23 ExtendLeaseOnNonLeased(OutboxState),
24
25 #[error("acquire_lease is only valid in pending state, got {0:?}")]
26 AcquireLeaseOnNonPending(OutboxState),
27}