mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +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:
@@ -29,19 +29,19 @@ use sp_core::{
|
||||
use std::sync::Arc;
|
||||
|
||||
/// CryptoStore error
|
||||
#[derive(Debug, derive_more::Display)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
/// Public key type is not supported
|
||||
#[display(fmt = "Key not supported: {:?}", _0)]
|
||||
#[error("Key not supported: {0:?}")]
|
||||
KeyNotSupported(KeyTypeId),
|
||||
/// Validation error
|
||||
#[display(fmt = "Validation error: {}", _0)]
|
||||
#[error("Validation error: {0}")]
|
||||
ValidationError(String),
|
||||
/// Keystore unavailable
|
||||
#[display(fmt = "Keystore unavailable")]
|
||||
#[error("Keystore unavailable")]
|
||||
Unavailable,
|
||||
/// Programming errors
|
||||
#[display(fmt = "An unknown keystore error occurred: {}", _0)]
|
||||
#[error("An unknown keystore error occurred: {0}")]
|
||||
Other(String),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user