pub enum ClientError {
MISSING_AUTH_HEADER,
NO_BEARER_PREFIX,
INVALID_CREDENTIALS,
SERVICE_ERROR,
USER_ALREADY_EXISTS,
USER_NOT_FOUND {
user_id: String,
},
INVALID_REQUEST_BODY(String),
DAILY_CHALLENGE_ALREADY_COMPLETED {
challenge_id: Uuid,
},
}
Expand description
This is the error type that is returned to the client.
This error type can only be retrieved after mapping a server error to a client error.
Variants§
MISSING_AUTH_HEADER
This error will occur if the request does not contain an Authorization
header.
NO_BEARER_PREFIX
This error will occur if the request does not contain a Bearer
prefix in the
Authorization
header.
INVALID_CREDENTIALS
This error will occur if the token in the Authorization
header is invalid.
SERVICE_ERROR
This error will occur if a server error is not mapped to client error.
USER_ALREADY_EXISTS
This error will occur if a user attempts to create a user that already exists in the database.
USER_NOT_FOUND
This error will occur if an authenticated user is not found in the database.
INVALID_REQUEST_BODY(String)
This error will occur if a request body is not valid JSON or it did not meet the requirements for serialization.
DAILY_CHALLENGE_ALREADY_COMPLETED
Trait Implementations§
Source§impl AsRef<str> for ClientError
impl AsRef<str> for ClientError
Source§impl Debug for ClientError
impl Debug for ClientError
Auto Trait Implementations§
impl Freeze for ClientError
impl RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnwindSafe for ClientError
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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