mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 22:41:06 +00:00
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:
@@ -22,7 +22,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0" }
|
||||
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
|
||||
sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" }
|
||||
sp-consensus-slots = { version = "0.10.0-dev", path = "../../../primitives/consensus/slots" }
|
||||
derive_more = "0.99.16"
|
||||
thiserror = "1.0"
|
||||
futures = "0.3.9"
|
||||
sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" }
|
||||
log = "0.4.8"
|
||||
|
||||
@@ -491,33 +491,34 @@ fn aura_err<B: BlockT>(error: Error<B>) -> Error<B> {
|
||||
}
|
||||
|
||||
/// Aura Errors
|
||||
#[derive(derive_more::Display, Debug)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error<B: BlockT> {
|
||||
/// Multiple Aura pre-runtime headers
|
||||
#[display(fmt = "Multiple Aura pre-runtime headers")]
|
||||
#[error("Multiple Aura pre-runtime headers")]
|
||||
MultipleHeaders,
|
||||
/// No Aura pre-runtime digest found
|
||||
#[display(fmt = "No Aura pre-runtime digest found")]
|
||||
#[error("No Aura pre-runtime digest found")]
|
||||
NoDigestFound,
|
||||
/// Header is unsealed
|
||||
#[display(fmt = "Header {:?} is unsealed", _0)]
|
||||
#[error("Header {0:?} is unsealed")]
|
||||
HeaderUnsealed(B::Hash),
|
||||
/// Header has a bad seal
|
||||
#[display(fmt = "Header {:?} has a bad seal", _0)]
|
||||
#[error("Header {0:?} has a bad seal")]
|
||||
HeaderBadSeal(B::Hash),
|
||||
/// Slot Author not found
|
||||
#[display(fmt = "Slot Author not found")]
|
||||
#[error("Slot Author not found")]
|
||||
SlotAuthorNotFound,
|
||||
/// Bad signature
|
||||
#[display(fmt = "Bad signature on {:?}", _0)]
|
||||
#[error("Bad signature on {0:?}")]
|
||||
BadSignature(B::Hash),
|
||||
/// Client Error
|
||||
#[error(transparent)]
|
||||
Client(sp_blockchain::Error),
|
||||
/// Unknown inherent error for identifier
|
||||
#[display(fmt = "Unknown inherent error for identifier: {}", "String::from_utf8_lossy(_0)")]
|
||||
#[error("Unknown inherent error for identifier: {}", String::from_utf8_lossy(.0))]
|
||||
UnknownInherentError(sp_inherents::InherentIdentifier),
|
||||
#[display(fmt = "Inherent error: {}", _0)]
|
||||
/// Inherents Error
|
||||
#[error("Inherent error: {0}")]
|
||||
Inherent(sp_inherents::Error),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user