pub enum AuthError {
Show 14 variants
InvalidCredentials,
InstallationNotFound {
installation_id: InstallationId,
},
TokenExpired,
InsufficientPermissions {
permission: String,
},
InvalidPrivateKey {
message: String,
},
JwtGenerationFailed {
message: String,
},
TokenGenerationFailed {
message: String,
},
TokenExchangeFailed {
installation_id: InstallationId,
message: String,
},
GitHubApiError {
status: u16,
message: String,
},
SigningError(SigningError),
SecretError(SecretError),
CacheError(CacheError),
NetworkError(String),
ApiError(ApiError),
}Expand description
Authentication-related errors with retry classification.
This error type covers all authentication failures including credential issues, token expiration, and GitHub API errors. Each variant includes metadata to support intelligent retry logic and detailed error reporting.
Variants§
InvalidCredentials
Invalid GitHub App credentials (non-retryable).
InstallationNotFound
Installation not found or access denied (non-retryable).
Fields
installation_id: InstallationIdTokenExpired
Installation token has expired (retryable via refresh).
InsufficientPermissions
Insufficient permissions for the requested operation (non-retryable).
InvalidPrivateKey
Invalid private key format or data (non-retryable).
JwtGenerationFailed
JWT generation failed (non-retryable).
TokenGenerationFailed
Token generation failed (non-retryable).
TokenExchangeFailed
Token exchange with GitHub API failed.
GitHubApiError
GitHub API returned an error response.
SigningError(SigningError)
JWT signing operation failed.
SecretError(SecretError)
Secret retrieval from secure storage failed.
CacheError(CacheError)
Token cache operation failed.
NetworkError(String)
Network connectivity or transport error.
ApiError(ApiError)
GitHub API client error.
Implementations§
Source§impl AuthError
impl AuthError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check if this error represents a transient condition that may succeed if retried.
Transient errors include:
- Network failures
- Server errors (5xx)
- Rate limiting (429)
- Token expiration (can refresh)
- Cache failures (can regenerate)
Non-transient errors include:
- Invalid credentials
- Missing installations
- Insufficient permissions
- Client errors (4xx except 429)
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Determine if this error should trigger a retry attempt.
Alias for is_transient() to support different retry policy conventions.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Get the recommended retry delay for this error.
Returns Some(Duration) if a specific delay is recommended (e.g., rate limiting),
or None to use the default exponential backoff policy.
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
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()
Source§impl From<CacheError> for AuthError
impl From<CacheError> for AuthError
Source§fn from(source: CacheError) -> Self
fn from(source: CacheError) -> Self
Source§impl From<SecretError> for AuthError
impl From<SecretError> for AuthError
Source§fn from(source: SecretError) -> Self
fn from(source: SecretError) -> Self
Source§impl From<SigningError> for AuthError
impl From<SigningError> for AuthError
Source§fn from(source: SigningError) -> Self
fn from(source: SigningError) -> Self
Auto Trait Implementations§
impl Freeze for AuthError
impl !RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnsafeUnpin for AuthError
impl !UnwindSafe for AuthError
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
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> 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.