pub enum ErrorCode {
Show 20 variants
InvalidCredentials = 1_001,
EmailNotConfirmed = 1_002,
TooManyLoginAttempts = 1_003,
InvalidToken = 1_004,
ExpiredToken = 1_005,
TokenRequired = 1_006,
EmailAlreadyExists = 1_007,
UseGoogleLogin = 1_008,
UseGithubLogin = 1_009,
UseEmailLogin = 1_010,
EmailNotVerified = 1_011,
InvalidInput = 2_001,
PasswordTooWeak = 2_002,
EmailInvalid = 2_003,
InvalidOrExpiredConfirmationToken = 2_004,
AccessDenied = 3_001,
InsufficientPermissions = 3_002,
ResourceNotFound = 4_001,
DatabaseError = 5_001,
InternalServerError = 5_002,
}
Expand description
Error code structure to be sent to frontend
Variants§
InvalidCredentials = 1_001
Error returned when credentials provided don’t match our records
EmailNotConfirmed = 1_002
Error returned when a user attempts to login with an unconfirmed email
TooManyLoginAttempts = 1_003
Error returned when there have been too many failed login attempts
InvalidToken = 1_004
Error returned when an authentication token is invalid
ExpiredToken = 1_005
Error returned when an authentication token has expired
TokenRequired = 1_006
Error returned when a token is required but not provided
EmailAlreadyExists = 1_007
Error returned when attempting to register with an email that already exists
UseGoogleLogin = 1_008
Error returned when a user tries to sign in with password but should use Google
UseGithubLogin = 1_009
Error returned when a user tries to sign in with password but should use GitHub
UseEmailLogin = 1_010
Error returned when a user tries to use OAuth but should use email/password
EmailNotVerified = 1_011
Error returned when a user’s email is not verified with their OAuth provider
InvalidInput = 2_001
Error returned when input fails validation rules
PasswordTooWeak = 2_002
Error returned when password doesn’t meet strength requirements
EmailInvalid = 2_003
Error returned when email format is invalid
InvalidOrExpiredConfirmationToken = 2_004
Error returned when a confirmation token is invalid or has expired
AccessDenied = 3_001
Error returned when a user is denied access to a resource
InsufficientPermissions = 3_002
Error returned when a user doesn’t have sufficient permissions for an action
ResourceNotFound = 4_001
Error returned when a requested resource cannot be found
DatabaseError = 5_001
Error returned when a database operation fails
InternalServerError = 5_002
Error returned when an unexpected server error occurs
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more