Skip to main content

appletheia_application/command/
idempotency_error.rs

1use std::error::Error;
2
3use thiserror::Error as ThisError;
4
5use crate::request_context::MessageId;
6
7#[derive(Debug, ThisError)]
8pub enum IdempotencyError {
9    #[error("idempotency key conflict: {message_id}")]
10    Conflict { message_id: MessageId },
11
12    #[error("invalid idempotency state transition")]
13    InvalidStateTransition,
14
15    #[error("persistence error: {0}")]
16    Persistence(#[source] Box<dyn Error + Send + Sync + 'static>),
17}