use thiserror instead of derive_more for error handling (#10696)

* use thiserror instead of derive_more for error handling

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update utils/prometheus/src/lib.rs

* Update utils/prometheus/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Qinxuan Chen
2022-01-26 03:48:46 +08:00
committed by GitHub
parent 38d94d6323
commit e956c2e1c7
47 changed files with 378 additions and 357 deletions
@@ -19,12 +19,12 @@ jsonrpc-core = "18.0.0"
jsonrpc-core-client = "18.0.0"
jsonrpc-derive = "18.0.0"
sp-consensus-babe = { version = "0.10.0-dev", path = "../../../../primitives/consensus/babe" }
serde = { version = "1.0.132", features=["derive"] }
serde = { version = "1.0.132", features = ["derive"] }
sp-blockchain = { version = "4.0.0-dev", path = "../../../../primitives/blockchain" }
sp-runtime = { version = "4.1.0-dev", path = "../../../../primitives/runtime" }
sc-consensus-epochs = { version = "0.10.0-dev", path = "../../epochs" }
futures = "0.3.16"
derive_more = "0.99.16"
thiserror = "1.0"
sp-api = { version = "4.0.0-dev", path = "../../../../primitives/api" }
sp-consensus = { version = "0.10.0-dev", path = "../../../../primitives/consensus/common" }
sp-core = { version = "4.1.0-dev", path = "../../../../primitives/core" }
@@ -166,11 +166,13 @@ pub struct EpochAuthorship {
}
/// Errors encountered by the RPC
#[derive(Debug, derive_more::Display, derive_more::From)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// Consensus error
Consensus(ConsensusError),
#[error(transparent)]
Consensus(#[from] ConsensusError),
/// Errors that can be formatted as a String
#[error("{0}")]
StringError(String),
}