use crate::ReplicationError;
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum ViewChangeError {
#[error(transparent)]
Replication(#[from] ReplicationError),
#[error("view must increase")]
ViewNotHigher,
#[error("durable view number exhausted")]
ViewExhausted,
#[error("old-view journal work has not settled")]
StoragePending,
#[error("a view promise is already pending")]
PromisePending,
#[error("requested view already promised")]
AlreadyPromised,
#[error("stale or foreign view-promise completion")]
StalePromise,
#[error("requested view promise has not completed")]
PromiseRequired,
#[error("start-view-change quorum missing")]
StartQuorumMissing,
#[error("do-view-change quorum missing")]
ReportQuorumMissing,
#[error("selected lineage evidence missing")]
HistoryMissing,
#[error("invalid frozen view-change report")]
InvalidReport,
#[error("conflicting view-change history")]
ConflictingHistory,
#[error("view selection already frozen")]
SelectionFrozen,
#[error("view has not been selected")]
SelectionRequired,
#[error("installation reused the old writer generation")]
ReusedGeneration,
#[error("stale or foreign installation completion")]
StaleInstallation,
#[error("installation already completed")]
InstallationCompleted,
#[error("installed application state is not at the required committed prefix")]
ApplicationPending,
#[error("view change faulted")]
Faulted,
}