diff options
Diffstat (limited to 'src/error')
| -rw-r--r-- | src/error/client.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/error/client.rs b/src/error/client.rs index 302581e..07d5f97 100644 --- a/src/error/client.rs +++ b/src/error/client.rs | |||
| @@ -5,6 +5,7 @@ pub enum ClientError { | |||
| 5 | InvalidPassword, | 5 | InvalidPassword, |
| 6 | NotAuthorized, | 6 | NotAuthorized, |
| 7 | UserNotFound { id: i64 }, | 7 | UserNotFound { id: i64 }, |
| 8 | NotQueueOwner { id: i64 }, | ||
| 8 | QueueNotFound { id: i64 }, | 9 | QueueNotFound { id: i64 }, |
| 9 | } | 10 | } |
| 10 | 11 | ||
| @@ -17,6 +18,7 @@ impl ClientError { | |||
| 17 | Self::InvalidPassword => "InvalidPassword", | 18 | Self::InvalidPassword => "InvalidPassword", |
| 18 | Self::NotAuthorized => "NotAuthorized", | 19 | Self::NotAuthorized => "NotAuthorized", |
| 19 | Self::UserNotFound { .. } => "UserNotFound", | 20 | Self::UserNotFound { .. } => "UserNotFound", |
| 21 | Self::NotQueueOwner { .. } => "NotQueueOwner", | ||
| 20 | Self::QueueNotFound { .. } => "QueueNotFound", | 22 | Self::QueueNotFound { .. } => "QueueNotFound", |
| 21 | } | 23 | } |
| 22 | .to_string() | 24 | .to_string() |
| @@ -33,6 +35,9 @@ impl ClientError { | |||
| 33 | 35 | ||
| 34 | Self::NotAuthorized => format!("user is not authorized"), | 36 | Self::NotAuthorized => format!("user is not authorized"), |
| 35 | Self::UserNotFound { id } => format!("user with id `{}` not found", id), | 37 | Self::UserNotFound { id } => format!("user with id `{}` not found", id), |
| 38 | Self::NotQueueOwner { id } => { | ||
| 39 | format!("you are not the owner of the queue with id `{}`", id) | ||
| 40 | } | ||
| 36 | Self::QueueNotFound { id } => format!("queue with id `{}` not found", id), | 41 | Self::QueueNotFound { id } => format!("queue with id `{}` not found", id), |
| 37 | } | 42 | } |
| 38 | } | 43 | } |
