mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
error: use derive-more Error for deriving error (#10841)
This commit is contained in:
@ -3,7 +3,7 @@ use reth_primitives::StaticFileSegment;
|
||||
|
||||
/// `UnifiedStorageWriter` related errors
|
||||
/// `StorageWriter` related errors
|
||||
#[derive(Clone, Debug, derive_more::Display, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, derive_more::Display, PartialEq, Eq, derive_more::Error)]
|
||||
pub enum UnifiedStorageWriterError {
|
||||
/// Database writer is missing
|
||||
#[display("Database writer is missing")]
|
||||
@ -18,16 +18,6 @@ pub enum UnifiedStorageWriterError {
|
||||
Database(DatabaseError),
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl std::error::Error for UnifiedStorageWriterError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
Self::Database(source) => std::error::Error::source(source),
|
||||
_ => Option::None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DatabaseError> for UnifiedStorageWriterError {
|
||||
fn from(error: DatabaseError) -> Self {
|
||||
Self::Database(error)
|
||||
|
||||
Reference in New Issue
Block a user