From 8333a6ba9a23e223af41e03d654835a86288a87f Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Fri, 12 Jul 2024 23:13:07 +0300
Subject: [PATCH] chore: New errors
Signed-off-by: Awiteb
---
crates/oxidetalis/src/websocket/errors.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/crates/oxidetalis/src/websocket/errors.rs b/crates/oxidetalis/src/websocket/errors.rs
index e2fab4b..ec39321 100644
--- a/crates/oxidetalis/src/websocket/errors.rs
+++ b/crates/oxidetalis/src/websocket/errors.rs
@@ -22,8 +22,15 @@ use crate::ws_errors;
pub type WsResult = Result;
ws_errors! {
+ InternalServerError = "Internal server error",
InvalidSignature = "Invalid event signature",
NotTextMessage = "The websocket message must be text message",
InvalidJsonData = "Received invalid json data, the text must be valid json",
UnknownClientEvent = "Unknown client event, the event is not recognized by the server",
+ RegistredUserEvent = "The event is only for registred users",
+ UserNotFound = "The user is not registered in the server",
+ AlreadyOnTheWhitelist = "The user is already on your whitelist",
+ AlreadySendChatRequest = "You have already sent a chat request to this user",
+ CannotSendChatRequestToSelf = "You cannot send a chat request to yourself",
+ CannotAddSelfToWhitelist = "You cannot add yourself to the whitelist",
}