reth_storage_errors/lockfile.rs
1use alloc::string::{String, ToString};
2use reth_fs_util::FsPathError;
3
4/// Storage lock error.
5#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]
6pub enum StorageLockError {
7 /// Write lock taken
8 #[display("storage directory is currently in use as read-write by another process: PID {_0}")]
9 Taken(usize),
10 /// Indicates other unspecified errors.
11 #[display("{_0}")]
12 Other(String),
13}
14
15impl core::error::Error for StorageLockError {}
16
17/// TODO: turn into variant once `ProviderError`
18impl From<FsPathError> for StorageLockError {
19 fn from(error: FsPathError) -> Self {
20 Self::Other(error.to_string())
21 }
22}