simplify kvdb error types (#8924)
This commit is contained in:
committed by
André Silva
parent
67721f3413
commit
5ef41ed53e
@@ -18,7 +18,6 @@
|
||||
|
||||
use std::{fmt, error};
|
||||
use std::time::SystemTime;
|
||||
use kvdb;
|
||||
use ethereum_types::{H256, U256, Address, Bloom};
|
||||
use util_error::{self, UtilError};
|
||||
use snappy::InvalidInput;
|
||||
@@ -237,11 +236,10 @@ error_chain! {
|
||||
}
|
||||
|
||||
links {
|
||||
Database(kvdb::Error, kvdb::ErrorKind) #[doc = "Database error."];
|
||||
Util(UtilError, util_error::ErrorKind) #[doc = "Error concerning a utility"];
|
||||
Import(ImportError, ImportErrorKind) #[doc = "Error concerning block import." ];
|
||||
}
|
||||
|
||||
|
||||
foreign_links {
|
||||
Io(IoError) #[doc = "Io create error"];
|
||||
StdIo(::std::io::Error) #[doc = "Error concerning the Rust standard library's IO subsystem."];
|
||||
@@ -271,14 +269,14 @@ error_chain! {
|
||||
AccountProvider(err: AccountsError) {
|
||||
description("Accounts Provider error")
|
||||
display("Accounts Provider error {}", err)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc = "PoW hash is invalid or out of date."]
|
||||
PowHashInvalid {
|
||||
description("PoW hash is invalid or out of date.")
|
||||
display("PoW hash is invalid or out of date.")
|
||||
}
|
||||
|
||||
|
||||
#[doc = "The value of the nonce or mishash is invalid."]
|
||||
PowInvalid {
|
||||
description("The value of the nonce or mishash is invalid.")
|
||||
@@ -311,10 +309,10 @@ impl From<ClientError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AccountsError> for Error {
|
||||
fn from(err: AccountsError) -> Error {
|
||||
impl From<AccountsError> for Error {
|
||||
fn from(err: AccountsError) -> Error {
|
||||
ErrorKind::AccountProvider(err).into()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<::rlp::DecoderError> for Error {
|
||||
|
||||
Reference in New Issue
Block a user