pub enum DeviceFlowError {
Show 16 variants
Network(Error),
Json(Error),
Url(ParseError),
OAuth {
error: String,
error_description: String,
},
AuthorizationDenied,
ExpiredToken,
SlowDown,
AuthorizationPending,
InvalidCode,
InvalidClient(String),
TokenExpired,
UnsupportedProvider(String),
MaxAttemptsExceeded(u32),
InvalidScope(String),
QrCode(QrError),
Other(String),
}
Expand description
Comprehensive error type for OAuth device flow operations
Variants§
Network(Error)
Network-related errors during HTTP requests
Json(Error)
JSON parsing errors
Url(ParseError)
URL parsing errors
OAuth
OAuth server returned an error
AuthorizationDenied
Device authorization request was denied
ExpiredToken
Device code has expired
SlowDown
Polling too frequently (slow down)
AuthorizationPending
Authorization is still pending
InvalidCode
Invalid device code
InvalidClient(String)
Invalid client configuration
TokenExpired
Token has expired and refresh failed
UnsupportedProvider(String)
Unsupported OAuth provider
MaxAttemptsExceeded(u32)
Maximum polling attempts exceeded
InvalidScope(String)
Invalid scope requested
QrCode(QrError)
QR code generation error (when feature is enabled)
Other(String)
Generic error for unexpected situations
Implementations§
Source§impl DeviceFlowError
impl DeviceFlowError
Sourcepub fn oauth_error(
error: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn oauth_error( error: impl Into<String>, description: impl Into<String>, ) -> Self
Create a new OAuth error
Sourcepub fn invalid_client(message: impl Into<String>) -> Self
pub fn invalid_client(message: impl Into<String>) -> Self
Create a new invalid client error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
Sourcepub fn is_slow_down(&self) -> bool
pub fn is_slow_down(&self) -> bool
Check if this error indicates we should slow down polling
Sourcepub fn is_pending(&self) -> bool
pub fn is_pending(&self) -> bool
Check if this error indicates authorization is still pending
Trait Implementations§
Source§impl Debug for DeviceFlowError
impl Debug for DeviceFlowError
Source§impl Display for DeviceFlowError
impl Display for DeviceFlowError
Source§impl Error for DeviceFlowError
impl Error for DeviceFlowError
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
Source§impl From<Error> for DeviceFlowError
impl From<Error> for DeviceFlowError
Source§impl From<Error> for DeviceFlowError
impl From<Error> for DeviceFlowError
Source§impl From<ParseError> for DeviceFlowError
impl From<ParseError> for DeviceFlowError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for DeviceFlowError
impl !RefUnwindSafe for DeviceFlowError
impl Send for DeviceFlowError
impl Sync for DeviceFlowError
impl Unpin for DeviceFlowError
impl !UnwindSafe for DeviceFlowError
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.