pub enum AuthError {
Show 19 variants
Configuration {
message: String,
},
AuthMethod {
method: String,
message: String,
},
Token(TokenError),
Permission(PermissionError),
Storage(StorageError),
Network(Error),
Json(Error),
Jwt(Error),
RateLimit {
message: String,
},
Mfa(MfaError),
DeviceFlow(DeviceFlowError),
OAuthProvider(OAuthProviderError),
UserProfile {
message: String,
},
InvalidCredential {
credential_type: String,
message: String,
},
Timeout {
timeout_seconds: u64,
},
ProviderNotConfigured {
provider: String,
},
Crypto {
message: String,
},
Validation {
message: String,
},
Internal {
message: String,
},
}Expand description
Main error type for the authentication framework.
Variants§
Configuration
Configuration errors
AuthMethod
Authentication method errors
Token(TokenError)
Token-related errors
Permission(PermissionError)
Permission-related errors
Storage(StorageError)
Storage-related errors
Network(Error)
Network/HTTP errors
Json(Error)
JSON parsing errors
Jwt(Error)
JWT errors
RateLimit
Rate limiting errors
Mfa(MfaError)
MFA-related errors
DeviceFlow(DeviceFlowError)
Device flow errors
OAuthProvider(OAuthProviderError)
OAuth provider errors
UserProfile
User profile errors
InvalidCredential
Credential validation errors
Timeout
Authentication timeout
ProviderNotConfigured
Provider configuration missing
Crypto
Cryptography errors
Validation
Validation errors
Internal
Generic internal errors
Implementations§
Source§impl AuthError
impl AuthError
Sourcepub fn auth_method(
method: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn auth_method( method: impl Into<String>, message: impl Into<String>, ) -> Self
Create a new auth method error
Sourcepub fn rate_limit(message: impl Into<String>) -> Self
pub fn rate_limit(message: impl Into<String>) -> Self
Create a new rate limit error
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a new validation error
Sourcepub fn access_denied(message: impl Into<String>) -> Self
pub fn access_denied(message: impl Into<String>) -> Self
Create an access denied error
Sourcepub fn device_flow(error: DeviceFlowError) -> Self
pub fn device_flow(error: DeviceFlowError) -> Self
Create a device flow error
Sourcepub fn oauth_provider(error: OAuthProviderError) -> Self
pub fn oauth_provider(error: OAuthProviderError) -> Self
Create an OAuth provider error
Sourcepub fn user_profile(message: impl Into<String>) -> Self
pub fn user_profile(message: impl Into<String>) -> Self
Create a user profile error
Sourcepub fn invalid_credential(
credential_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_credential( credential_type: impl Into<String>, message: impl Into<String>, ) -> Self
Create an invalid credential error
Sourcepub fn provider_not_configured(provider: impl Into<String>) -> Self
pub fn provider_not_configured(provider: impl Into<String>) -> Self
Create a provider not configured error
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<DeviceFlowError> for AuthError
impl From<DeviceFlowError> for AuthError
Source§fn from(source: DeviceFlowError) -> Self
fn from(source: DeviceFlowError) -> Self
Converts to this type from the input type.
Source§impl From<OAuthProviderError> for AuthError
impl From<OAuthProviderError> for AuthError
Source§fn from(source: OAuthProviderError) -> Self
fn from(source: OAuthProviderError) -> Self
Converts to this type from the input type.
Source§impl From<PermissionError> for AuthError
impl From<PermissionError> for AuthError
Source§fn from(source: PermissionError) -> Self
fn from(source: PermissionError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for AuthError
impl From<StorageError> for AuthError
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> Self
Converts to this type from the input type.
Source§impl From<TokenError> for AuthError
impl From<TokenError> for AuthError
Source§fn from(source: TokenError) -> Self
fn from(source: TokenError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AuthError
impl !RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl !UnwindSafe for AuthError
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