#[non_exhaustive]pub enum DeviceFlowError {
Http {
step: DeviceFlowStep,
source: Error,
},
DeviceCodeRejected(String),
MissingField(&'static str),
Expired,
AccessDenied,
TimedOut,
TokenRejected(String),
UnexpectedResponse,
}Expand description
Ways the device flow can fail.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Http
The HTTP request itself failed (network, TLS, non-success status).
Fields
§
step: DeviceFlowStepWhich request failed.
§
source: ErrorThe transport error from the HttpClient.
DeviceCodeRejected(String)
GitHub answered the device-code request with an OAuth error code
(for example an unknown client id).
MissingField(&'static str)
A required field was absent from GitHub’s device-code response.
Expired
The device code expired before the user authorized (expired_token).
AccessDenied
The user declined to authorize the app (access_denied).
TimedOut
DeviceAuthorization::expires_in elapsed while waiting.
TokenRejected(String)
The token endpoint answered with an OAuth error code the flow does not
handle (for example incorrect_device_code).
UnexpectedResponse
The token endpoint answered with neither a token nor an error code.
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)>
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()
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceFlowError
impl !UnwindSafe for DeviceFlowError
impl Freeze for DeviceFlowError
impl Send for DeviceFlowError
impl Sync for DeviceFlowError
impl Unpin for DeviceFlowError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more