switch from custom_error to thiserror

This commit is contained in:
Samuel Lorch 2023-10-29 22:05:17 +01:00
parent c10f5529d6
commit 7fcf84f62e
5 changed files with 41 additions and 24 deletions

View file

@ -12,12 +12,19 @@ use jsonrpsee::{
RpcModule,
};
use custom_error::custom_error;
use thiserror::Error;
use tracing::info;
custom_error! { pub ApiError
InvalidParams = "Invalid Parameters",
Leet = "1337",
#[derive(Error, Debug)]
pub enum ApiError {
#[error("Unsupported config version")]
InvalidParams,
#[error("1337")]
Leet,
#[error(transparent)]
ConfigError(#[from] crate::config_manager::ConfigError),
}
impl Into<ErrorObject<'static>> for ApiError {