pub struct OAuthFailure {
pub class: ErrorClass,
pub permanent: bool,
pub detail: String,
}Expand description
The provider’s typed refusal. Classified under the R0.6 ErrorClass
taxonomy so the retry policy plane reads it unchanged; permanent
marks the terminal refusals — invalid_grant, an expired refresh
token — that flip the connection to needs_reauth rather than retry:
a stale credential retried looks exactly like an attack retried. The
detail is human-facing context (the provider’s error), never
credential material.
Fields§
§class: ErrorClassThe retry-taxonomy class of the failure.
permanent: booltrue for terminal refusals (invalid_grant and kin): the
connection flips to needs_reauth and calls fail closed until a
human records a new consent act.
detail: StringHuman-facing context, never credential material.
Implementations§
Source§impl OAuthFailure
impl OAuthFailure
Sourcepub fn permanent(detail: impl Into<String>) -> Self
pub fn permanent(detail: impl Into<String>) -> Self
A terminal refusal (permanent: true, classed InvalidInput — the
taxonomy’s “the same bytes will fail the same way on every attempt”
bucket, which a stale grant is exactly).
Sourcepub fn transient(class: ErrorClass, detail: impl Into<String>) -> Self
pub fn transient(class: ErrorClass, detail: impl Into<String>) -> Self
A retryable failure (permanent: false) under class.
Trait Implementations§
Source§impl Clone for OAuthFailure
impl Clone for OAuthFailure
Source§impl Debug for OAuthFailure
impl Debug for OAuthFailure
Source§impl Display for OAuthFailure
impl Display for OAuthFailure
Source§impl Error for OAuthFailure
impl Error for OAuthFailure
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()