1#[cfg(feature = "rocksdb")]
2use rocksdb::Error as RocksError;
3
4use thiserror::Error;
5
6#[derive(Error, Debug, PartialEq)]
7pub enum StorageError {
8 #[cfg(feature = "rocksdb")]
9 #[error("Failed to initialize rocksDB.")]
10 RocksError(#[from] RocksError),
11
12 #[cfg(feature = "hashmap")]
13 #[error("Unknown Hashmap error.")]
14 HashMap,
15
16 #[error("Failed to create directory- {0}")]
17 DirectoryError(String),
18
19 #[cfg(feature = "rocksdb")]
20 #[error("Failed to create directory for RocksDB storage - {0}")]
21 RocksDirectoryError(String),
22
23 #[cfg(feature = "fs")]
24 #[error("Failed to create directory for Fs storage - {0}")]
25 FsDirectoryError(String),
26
27 #[cfg(feature = "fs")]
28 #[error("Failed to write in Fs storage - {0}")]
29 FsWriteError(String),
30
31 #[cfg(feature = "fs")]
32 #[error("Failed to read in Fs storage - {0}")]
33 FsReadError(String),
34
35 #[cfg(feature = "fs")]
36 #[error("Failed to move Fs directory - {0}")]
37 FsDirectoryMoveError(String),
38
39 #[cfg(feature = "fs")]
40 #[error("Failed to delete directory from Fs storage - {0}")]
41 FsDirectoryDeletionError(String),
42
43 #[cfg(feature = "fs")]
44 #[error("Path not valid - {0}")]
45 FsPathError(String),
46}