Added NoUserInfo, NoMessageText and HandlerUsed error types to decrease the amount of unwraps

This commit is contained in:
2023-05-06 20:20:33 +03:00
parent c1e1b9c0c1
commit 71940762ff
18 changed files with 74 additions and 38 deletions

11
src/errors.rs Normal file
View File

@@ -0,0 +1,11 @@
#[derive(thiserror::Error, Debug)]
#[error("No user info found")]
pub struct NoUserInfo;
#[derive(thiserror::Error, Debug)]
#[error("Message text not found")]
pub struct NoMessageText;
#[derive(thiserror::Error, Debug)]
#[error("Handler was already used")]
pub struct HandlerUsed;