pub enum OAuthError {
Show 17 variants
PkceNotInitialized,
TokenExchangeFailed(String),
TokenRefreshFailed(String),
ApiKeyCreationFailed,
UnknownMethod(String),
InvalidHeader,
HttpError(Error),
JsonError(Error),
ParseError(String),
InvalidCodeFormat(String),
ProviderNotFound(String),
OAuthNotSupported,
IoError(Error),
TomlSerError(Error),
TomlDeError(Error),
AuthRequired,
TokenExpired,
}Expand description
Errors that can occur during OAuth operations
Variants§
PkceNotInitialized
PKCE challenge was not initialized before token exchange
TokenExchangeFailed(String)
Token exchange failed
TokenRefreshFailed(String)
Token refresh failed
ApiKeyCreationFailed
API key creation failed
UnknownMethod(String)
Unknown authentication method
InvalidHeader
Invalid header value
HttpError(Error)
HTTP request error
JsonError(Error)
JSON parsing error
ParseError(String)
Parse error
InvalidCodeFormat(String)
Invalid authorization code format
ProviderNotFound(String)
Provider not found
OAuthNotSupported
OAuth not supported for this method
IoError(Error)
File I/O error
TomlSerError(Error)
TOML serialization error
TomlDeError(Error)
TOML deserialization error
AuthRequired
Authentication required
TokenExpired
Token expired and refresh failed
Implementations§
Source§impl OAuthError
impl OAuthError
Sourcepub fn token_exchange_failed(msg: impl Into<String>) -> Self
pub fn token_exchange_failed(msg: impl Into<String>) -> Self
Create a token exchange failed error
Sourcepub fn token_refresh_failed(msg: impl Into<String>) -> Self
pub fn token_refresh_failed(msg: impl Into<String>) -> Self
Create a token refresh failed error
Sourcepub fn parse_error(msg: impl Into<String>) -> Self
pub fn parse_error(msg: impl Into<String>) -> Self
Create a parse error
Sourcepub fn invalid_code_format(msg: impl Into<String>) -> Self
pub fn invalid_code_format(msg: impl Into<String>) -> Self
Create an invalid code format error
Sourcepub fn provider_not_found(provider: impl Into<String>) -> Self
pub fn provider_not_found(provider: impl Into<String>) -> Self
Create a provider not found error
Sourcepub fn unknown_method(method: impl Into<String>) -> Self
pub fn unknown_method(method: impl Into<String>) -> Self
Create an unknown method error
Trait Implementations§
Source§impl Debug for OAuthError
impl Debug for OAuthError
Source§impl Display for OAuthError
impl Display for OAuthError
Source§impl Error for OAuthError
impl Error for OAuthError
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<Error> for OAuthError
impl From<Error> for OAuthError
Source§impl From<Error> for OAuthError
impl From<Error> for OAuthError
Source§impl From<Error> for OAuthError
impl From<Error> for OAuthError
Source§impl From<Error> for OAuthError
impl From<Error> for OAuthError
Auto Trait Implementations§
impl Freeze for OAuthError
impl !RefUnwindSafe for OAuthError
impl Send for OAuthError
impl Sync for OAuthError
impl Unpin for OAuthError
impl !UnwindSafe for OAuthError
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