use thiserror::Error;
#[derive(Debug, Error)]
pub enum RecoveryError {
#[error("trimmed_count != 0 but WAL recovery tail missing first event")]
WalTailMissingFirst,
#[error("trimmed_count != 0 but WAL recovery tail missing last event")]
WalTailMissingLast,
}
#[derive(Debug, Error)]
pub enum WalError {
#[error("WAL schema mismatch: expected {expected}, found {found} (wipe the WAL directory)")]
SchemaMismatch { expected: u64, found: u64 },
#[error("corrupt WAL record at app_seq={app_seq}: {details}")]
CorruptRecord { app_seq: u64, details: String },
#[error("invalid tx framing at app_seq={app_seq}: tx_id={tx_id} tx_len={tx_len} tx_ix={tx_ix}")]
InvalidTxFraming {
app_seq: u64,
tx_id: u64,
tx_len: u16,
tx_ix: u16,
},
}
#[derive(Debug, Error)]
pub enum RuntimeError {
#[error("wal thread panicked")]
WalThreadPanic,
}