sim_lib_operation_gate/
operation_error.rs1use sim_lib_journal::JournalError;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
6pub enum OperationError {
7 #[error("operation name is empty")]
9 EmptyOperation,
10 #[error("noncanonical {0}")]
12 NonCanonical(&'static str),
13 #[error("contradictory intent under one operation id")]
15 ContradictoryIntent,
16 #[error("operation grant does not match intent")]
18 GrantMismatch,
19 #[error("operation attempt does not match intent")]
21 AttemptMismatch,
22 #[error("invalid bounded operation lease")]
24 InvalidLease,
25 #[error("postcondition observer is not independent of the performer")]
27 ObserverNotIndependent,
28 #[error("operation performer does not match the durable dispatch authority")]
30 PerformerMismatch,
31 #[error("durable operation contains duplicate intent")]
33 DuplicateIntent,
34 #[error("invalid durable operation transition: {0}")]
36 InvalidTransition(&'static str),
37 #[error("operation service must be explicitly resumed")]
39 NotResumed,
40 #[error("operation journal sequence is exhausted")]
42 SequenceExhausted,
43 #[error(transparent)]
45 Journal(#[from] JournalError),
46}