pub enum Error {
Registry(String),
UnknownProvider(String),
UnsupportedMethod {
provider: String,
method: &'static str,
},
Http(String),
Authorization(String),
StateMismatch,
Loopback(String),
Timeout,
Cancelled,
Malformed(String),
Store(String),
}Expand description
Everything that can go wrong during provider discovery or a sign-in flow.
Variants stay coarse on purpose: a consuming CLI renders them to the user, so each carries enough context to explain itself without leaking secrets.
Variants§
Registry(String)
The provider registry data (TOML) could not be parsed.
UnknownProvider(String)
A provider id was requested that the registry does not define.
UnsupportedMethod
The provider does not offer the requested authentication method.
Fields
Http(String)
A network request failed.
Authorization(String)
The authorization server returned an error response (RFC 6749 §5.2 /
§3.1.2.6). The string is the server-provided error code plus any
error_description, never a token.
StateMismatch
The OAuth redirect returned a state that did not match the one we sent,
which means the response cannot be trusted (possible CSRF).
Loopback(String)
The loopback redirect listener could not be started or accepted.
Timeout
The device-code flow was still pending when the deadline elapsed.
Cancelled
The user (or the authorization server) cancelled the flow.
Malformed(String)
A token or discovery response was missing a required field.
Store(String)
A credential store operation failed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
use the Display impl or to_string()