pub enum Error {
Show 17 variants
Network(String),
Discovery(String),
Jwks(String),
Verification(String),
OAuth {
error: String,
description: Option<String>,
},
InvalidParam(&'static str),
ServerOnly,
RequireRecentLogin,
Timeout,
HttpClient(HttpClientError),
Json(Error),
UrlParse(ParseError),
Base64(String),
Jwt(String),
Cache(String),
MissingConfig(&'static str),
InvalidState(String),
}Expand description
Main error type for the xjp-oidc SDK
Variants§
Network(String)
Network-related errors
Discovery(String)
Discovery endpoint errors
Jwks(String)
JWKS endpoint errors
Verification(String)
Token verification failures
OAuth
OAuth/OIDC protocol errors from the server
Fields
InvalidParam(&'static str)
Invalid parameter provided to a function
ServerOnly
Attempt to use server-only function in browser/WASM environment
RequireRecentLogin
Recent login required (step-up authentication needed)
Timeout
Operation timed out
HttpClient(HttpClientError)
HTTP client errors
Json(Error)
JSON parsing errors
UrlParse(ParseError)
URL parsing errors
Base64(String)
Base64 decoding errors
Jwt(String)
JWT/JWS errors
Cache(String)
Cache-related errors
MissingConfig(&'static str)
Missing required configuration
InvalidState(String)
Invalid state during operation
Implementations§
Source§impl Error
impl Error
Sourcepub fn oauth(error: impl Into<String>, description: Option<String>) -> Self
pub fn oauth(error: impl Into<String>, description: Option<String>) -> Self
Create an OAuth error from server response
Sourcepub fn is_oauth_error(&self, code: &str) -> bool
pub fn is_oauth_error(&self, code: &str) -> bool
Check if this is a specific OAuth error code
Sourcepub fn requires_recent_login(&self) -> bool
pub fn requires_recent_login(&self) -> bool
Check if this error indicates that recent login is required
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
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)>
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()
Source§impl From<HttpClientError> for Error
impl From<HttpClientError> for Error
Source§fn from(source: HttpClientError) -> Self
fn from(source: HttpClientError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.