solana_accounts_db/tiered_storage/
error.rs

1use {super::footer::SanitizeFooterError, std::path::PathBuf, thiserror::Error};
2
3#[derive(Error, Debug)]
4pub enum TieredStorageError {
5    #[error("I/O error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("MagicNumberMismatch: expected {0}, found {1}")]
9    MagicNumberMismatch(u64, u64),
10
11    #[error("AttemptToUpdateReadOnly: attempted to update read-only file {0}")]
12    AttemptToUpdateReadOnly(PathBuf),
13
14    #[error("UnknownFormat: the tiered storage format is unknown for file {0}")]
15    UnknownFormat(PathBuf),
16
17    #[error("Unsupported: the feature is not yet supported")]
18    Unsupported(),
19
20    #[error("invalid footer size: {0}, expected: {1}")]
21    InvalidFooterSize(u64, u64),
22
23    #[error("invalid footer version: {0}")]
24    InvalidFooterVersion(u64),
25
26    #[error("footer is unsanitary: {0}")]
27    SanitizeFooter(#[from] SanitizeFooterError),
28
29    #[error("OffsetOutOfBounds: offset {0} is larger than the supported size {1}")]
30    OffsetOutOfBounds(usize, usize),
31
32    #[error("OffsetAlignmentError: offset {0} must be multiple of {1}")]
33    OffsetAlignmentError(usize, usize),
34
35    #[error("failed to flush hot storage writer: {0}")]
36    FlushHotWriter(#[source] std::io::Error),
37}