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
//! Copyright (c) 2022 MASSA LABS <info@massa.net>

//! This file defines all error types for final state management

use displaydoc::Display;
use thiserror::Error;

use massa_versioning::versioning::{ExtendFromDbError, IsConsistentWithShutdownPeriodError};

/// Final state error
#[non_exhaustive]
#[derive(Display, Error, Debug)]
pub enum FinalStateError {
    /// invalid slot: {0}
    InvalidSlot(String),
    /// ledger error: {0}
    LedgerError(String),
    /// PoS error: {0}
    PosError(String),
    /// Snapshot error: {0}
    SnapshotError(String),
    /// ExtendFromDbError
    ExtendFromDbError(#[from] ExtendFromDbError),
    /// IsConsistentWithShutdownPeriodError
    NonConsistentWithShutdownPeriodError(#[from] IsConsistentWithShutdownPeriodError),
}