pub enum AuthenticationError {
InvalidCredentials,
EmptyField {
identity: bool,
password: bool,
},
IdentityMustBeEmail,
HttpError(Error),
UnexpectedResponse,
MissingCollection,
}Expand description
Represents errors that can occur during the authentication process with the PocketBase API.
This enum defines various error types that may arise when attempting to authenticate, each providing details about the specific issue encountered.
Variants§
InvalidCredentials
Communication with the PocketBase API was successful,
but returned a 400 Bad Request HTTP error response.
Tip: The credentials you provided may be incorrect.
EmptyField
Email and/or Password cannot be empty.
This variant indicates that certain fields in the authentication request need to be validated. The fields are represented as booleans:
identity: is blank and shouldn’t be.password: is blank and shouldn’t be.
IdentityMustBeEmail
The provided identity must be an email address.
This variant indicates that the authentication request failed because the provided identity
does not conform to the expected email format. The PocketBase API requires the identity to
be a valid email address for authentication.
HttpError(Error)
An HTTP error occurred while communicating with the PocketBase API.
This variant wraps a reqwest::Error and indicates that the request could not be completed
due to network issues, invalid URL, timeouts, etc.
UnexpectedResponse
When something unexpected was returned by the PocketBase REST API.
Would usually mean that there is an error somewhere in this API wrapper.
MissingCollection
Occurs when you try to authenticate a PocketBase client without providing the collection name.
Trait Implementations§
Source§impl Debug for AuthenticationError
impl Debug for AuthenticationError
Source§impl Display for AuthenticationError
impl Display for AuthenticationError
Source§impl Error for AuthenticationError
impl Error for AuthenticationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for AuthenticationError
impl !RefUnwindSafe for AuthenticationError
impl Send for AuthenticationError
impl Sync for AuthenticationError
impl Unpin for AuthenticationError
impl !UnwindSafe for AuthenticationError
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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.