1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use sim_lib_journal::JournalError;
use thiserror::Error;
/// Typed refusal from durable operation construction, replay, or publication.
#[derive(Debug, Error)]
pub enum OperationError {
/// An operation name cannot be empty.
#[error("operation name is empty")]
EmptyOperation,
/// A supplied value was not the canonical value claimed by its identity.
#[error("noncanonical {0}")]
NonCanonical(&'static str),
/// The same claimed operation identity carried different intent.
#[error("contradictory intent under one operation id")]
ContradictoryIntent,
/// A grant did not belong to the stable operation.
#[error("operation grant does not match intent")]
GrantMismatch,
/// An attempt did not belong to the stable operation.
#[error("operation attempt does not match intent")]
AttemptMismatch,
/// A bounded operation lease was empty, expired at acquisition, or moved backwards.
#[error("invalid bounded operation lease")]
InvalidLease,
/// The postcondition observer was the same authority as the performer.
#[error("postcondition observer is not independent of the performer")]
ObserverNotIndependent,
/// Recovery selected a different performer authority for the same operation.
#[error("operation performer does not match the durable dispatch authority")]
PerformerMismatch,
/// Durable replay contained a second intent for one operation.
#[error("durable operation contains duplicate intent")]
DuplicateIntent,
/// A durable event violated the operation state order.
#[error("invalid durable operation transition: {0}")]
InvalidTransition(&'static str),
/// The service has no live fenced writer lease.
#[error("operation service must be explicitly resumed")]
NotResumed,
/// The journal sequence cannot be extended.
#[error("operation journal sequence is exhausted")]
SequenceExhausted,
/// The underlying canonical journal refused the operation.
#[error(transparent)]
Journal(#[from] JournalError),
}