From 15c744e995805a30700cb04c488cddbb3015316b Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Thu, 25 Sep 2025 01:20:24 +0300 Subject: Add basic queue CRUD --- src/error/client.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/error') diff --git a/src/error/client.rs b/src/error/client.rs index 980e3d2..70b6001 100644 --- a/src/error/client.rs +++ b/src/error/client.rs @@ -4,6 +4,8 @@ pub enum ClientError { UserAlreadyExists { username: String }, InvalidPassword, NotAuthorized, + UserNotFound { id: i64 }, + QueueNotFound { id: i64 }, } impl ClientError { @@ -14,6 +16,8 @@ impl ClientError { Self::UserAlreadyExists { .. } => "UserAlreadyExists", Self::InvalidPassword => "InvalidPassword", Self::NotAuthorized => "NotAuthorized", + Self::UserNotFound { .. } => "UserNotFound", + Self::QueueNotFound { .. } => "QueueNotFound", } .to_string() } @@ -25,9 +29,11 @@ impl ClientError { Self::UserAlreadyExists { username } => { format!("user with username `{}` already exists", username) } - Self::InvalidPassword => "password is invalid".to_string(), + Self::InvalidPassword => format!("password is invalid"), - Self::NotAuthorized => "user is not authorized".to_string(), + Self::NotAuthorized => format!("user is not authorized"), + Self::UserNotFound { id } => format!("user with id `{}` not found", id), + Self::QueueNotFound { id } => format!("queue with id `{}` not found", id), } } } -- cgit v1.2.3