Updated derive more to v1. Removed thiserror

This commit is contained in:
2024-08-11 12:19:33 +03:00
parent 5c789533e3
commit 14b858808d
4 changed files with 101 additions and 66 deletions

View File

@@ -1,23 +1,23 @@
use std::fmt::{Debug, Display};
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
#[derive(thiserror::Error, Debug)]
#[error("No user info found")]
#[derive(derive_more::Error, derive_more::Display, Debug)]
#[display("No user info found")]
pub struct NoUserInfo;
#[derive(thiserror::Error, Debug)]
#[error("Handler was already used")]
#[derive(derive_more::Error, derive_more::Display, Debug)]
#[display("Handler was already used")]
pub struct HandlerUsed;
#[derive(thiserror::Error, Debug)]
#[derive(derive_more::Error, derive_more::Display, derive_more::From, Debug)]
pub enum InvalidCommand {
#[error("Invalid params")]
#[display("Invalid params")]
InvalidParams,
#[error("Not enough bytes in the name's hash")]
#[display("Not enough bytes in the name's hash")]
InvalidOutputLength,
#[error("Error decoding the values: {0}")]
NameDecodingError(#[from] base64::DecodeError),
#[error("Unknown locale passed into callback")]
#[display("Error decoding the values: {}", 0)]
NameDecodingError(base64::DecodeError),
#[display("Unknown locale passed into callback")]
UnknownLocale,
}