Refactor for global error type
This commit is contained in:
1
shared/src/lib.rs
Normal file
1
shared/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod types;
|
||||
21
shared/src/types.rs
Normal file
21
shared/src/types.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub enum ErrorCode {
|
||||
Error,
|
||||
Unauthorized,
|
||||
EmailTaken,
|
||||
UsernameTaken,
|
||||
InvalidLoginCode,
|
||||
InvalidImage,
|
||||
InvalidUsername,
|
||||
InvalidEmail,
|
||||
InvalidToken,
|
||||
UnableToConnectToMail,
|
||||
UnableToSendMail,
|
||||
|
||||
MessageNotFound,
|
||||
RoomNotFound,
|
||||
UserNotFound,
|
||||
MalformedDBResponse,
|
||||
}
|
||||
Reference in New Issue
Block a user