polyc_eventlog/error.rs
1//! Errors surfaced by the event log.
2
3/// Failures from opening, appending to, or replaying an [`crate::EventLog`].
4///
5/// This is a thin wrapper over the underlying
6/// [`commonware_storage::journal::Error`]: every fallible event-log operation
7/// delegates to the journal primitive, so the storage error is the only failure
8/// mode and is preserved verbatim as the [`Self::Journal`] source.
9#[derive(Debug, thiserror::Error)]
10#[non_exhaustive]
11pub enum EventLogError {
12 /// The underlying commonware-storage journal returned an error while
13 /// opening, appending, committing, or replaying.
14 #[error("event log journal error: {0}")]
15 Journal(#[from] commonware_storage::journal::Error),
16 /// The durable event-count checkpoint ([`crate::checkpoint`]) failed to
17 /// open, read, or sync.
18 #[error("event log checkpoint error: {0}")]
19 Checkpoint(#[from] commonware_storage::metadata::Error),
20 /// A partition's tamper-evidence tree could not be rebuilt, or its root
21 /// could not be signed.
22 ///
23 /// A rewrite reports this rather than proceeding: every root the partition
24 /// carried was signed over content the rewrite changes, so a rewrite that
25 /// cannot sign a fresh one would leave a partition whose signed history
26 /// does not describe what it holds.
27 #[error("event log integrity error: {0}")]
28 Integrity(#[from] crate::IntegrityError),
29}