mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
switch from custom_error to thiserror
This commit is contained in:
parent
c10f5529d6
commit
7fcf84f62e
5 changed files with 41 additions and 24 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue