pub struct RequestError { /* private fields */ }Expand description
OAuth request error for token operations and auth flows
Implementations§
Source§impl RequestError
impl RequestError
Sourcepub fn new(kind: RequestErrorKind, source: Option<BoxError>) -> Self
pub fn new(kind: RequestErrorKind, source: Option<BoxError>) -> Self
Create a new error with the given kind and optional source
Sourcepub fn kind(&self) -> &RequestErrorKind
pub fn kind(&self) -> &RequestErrorKind
Get the error kind
Sourcepub fn source_err(&self) -> Option<&BoxError>
pub fn source_err(&self) -> Option<&BoxError>
Get the source error if present
Sourcepub fn with_context(self, context: impl Into<SmolStr>) -> Self
pub fn with_context(self, context: impl Into<SmolStr>) -> Self
Add context to this error
Sourcepub fn with_details(self, details: impl Into<SmolStr>) -> Self
pub fn with_details(self, details: impl Into<SmolStr>) -> Self
Add details to this error
Sourcepub fn with_location(self, location: impl Into<SmolStr>) -> Self
pub fn with_location(self, location: impl Into<SmolStr>) -> Self
Add location to this error
Sourcepub fn no_endpoint(endpoint: impl Into<SmolStr>) -> Self
pub fn no_endpoint(endpoint: impl Into<SmolStr>) -> Self
Create a no endpoint error
Sourcepub fn token_verification() -> Self
pub fn token_verification() -> Self
Create a token verification error
Sourcepub fn unsupported_auth_method() -> Self
pub fn unsupported_auth_method() -> Self
Create an unsupported authentication method error
Sourcepub fn no_refresh_token() -> Self
pub fn no_refresh_token() -> Self
Create a no refresh token error
Sourcepub fn invalid_did(source: impl Error + Send + Sync + 'static) -> Self
pub fn invalid_did(source: impl Error + Send + Sync + 'static) -> Self
Create an invalid DID error
Sourcepub fn http_build(source: impl Error + Send + Sync + 'static) -> Self
pub fn http_build(source: impl Error + Send + Sync + 'static) -> Self
Create an HTTP build error
Sourcepub fn http_status(status: StatusCode) -> Self
pub fn http_status(status: StatusCode) -> Self
Create an HTTP status error
Sourcepub fn http_status_with_body(status: StatusCode, body: Value) -> Self
pub fn http_status_with_body(status: StatusCode, body: Value) -> Self
Create an HTTP status with body error
Sourcepub fn atproto(source: impl Error + Send + Sync + 'static) -> Self
pub fn atproto(source: impl Error + Send + Sync + 'static) -> Self
Create an atproto metadata error
Sourcepub fn par_required() -> Self
pub fn par_required() -> Self
Create an error for atproto metadata that does not advertise required PAR support.
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Returns true if this error indicates permanent auth failure (token revoked, refresh_token expired, etc.)
When this returns true, the session should be cleared from storage rather than retried.
Trait Implementations§
Source§impl Debug for RequestError
impl Debug for RequestError
Source§impl Diagnostic for RequestError
impl Diagnostic for RequestError
Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn diagnostic_source<'a>(&'a self) -> Option<&'a dyn Diagnostic>
fn diagnostic_source<'a>(&'a self) -> Option<&'a dyn Diagnostic>
Source§fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn code<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandlers to change the display format
of this diagnostic. Read moreSource§fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
fn url<'a>(&'a self) -> Option<Box<dyn Display + 'a>>
Diagnostic.Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic’s Diagnostic::labels to.Source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic’s Diagnostic::source_codeDiagnostics.Source§impl Display for RequestError
impl Display for RequestError
Source§impl Error for RequestError
impl Error for RequestError
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()