pub enum Error {
Http {
status: u16,
url: String,
body: String,
},
Network(Error),
Decode {
url: String,
source: Error,
},
StateMismatch {
actual: Option<String>,
expected: String,
},
Cancelled(String),
Timeout(Duration),
BadRequest(String),
Io(Error),
}Expand description
All errors surfaced by the crate.
Variants§
Http
The platform returned a non-2xx status. body is truncated to a
reasonable size before being attached.
Network(Error)
Underlying transport failure (DNS, TLS, connection reset, …).
Decode
The response body wasn’t valid JSON for the expected shape.
StateMismatch
The OAuth callback returned a state value that didn’t match
what we generated. Refusing the token is the only safe move.
Cancelled(String)
The user (or the platform) cancelled the OAuth flow in the
browser. The String carries the platform-supplied reason.
Timeout(Duration)
The OAuth handshake didn’t complete within the allotted time.
BadRequest(String)
Caller-side problem — usually a malformed input (e.g. a token that contains bytes we can’t put in an HTTP header).
Io(Error)
Local I/O failure (loopback bind, socket read/write, …).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()