massa_final_state/error.rs
1//! Copyright (c) 2022 MASSA LABS <info@massa.net>
2
3//! This file defines all error types for final state management
4
5use displaydoc::Display;
6use thiserror::Error;
7
8use massa_versioning::versioning::{ExtendFromDbError, IsConsistentWithShutdownPeriodError};
9
10/// Final state error
11#[non_exhaustive]
12#[derive(Display, Error, Debug)]
13pub enum FinalStateError {
14 /// invalid slot: {0}
15 InvalidSlot(String),
16 /// ledger error: {0}
17 LedgerError(String),
18 /// PoS error: {0}
19 PosError(String),
20 /// Snapshot error: {0}
21 SnapshotError(String),
22 /// ExtendFromDbError
23 ExtendFromDbError(#[from] ExtendFromDbError),
24 /// IsConsistentWithShutdownPeriodError
25 NonConsistentWithShutdownPeriodError(#[from] IsConsistentWithShutdownPeriodError),
26}