pub enum AppError {
Database(String),
LLM(String),
Auth(String),
NotFound(String),
InvalidInput(String),
Configuration(String),
External(String),
Internal(String),
Unavailable(String),
FeatureDisabled(String),
RateLimited(String),
}Expand description
Application-wide error type.
Variants§
Database(String)
Database operation failed.
LLM(String)
LLM operation failed.
Auth(String)
Authentication or authorization failed.
NotFound(String)
Requested resource was not found.
InvalidInput(String)
Input validation failed.
Configuration(String)
Configuration error.
External(String)
External service call failed.
Internal(String)
Internal server error.
Service temporarily unavailable (emergency stop, maintenance).
FeatureDisabled(String)
RAG feature was disabled by configuration
RateLimited(String)
Rate limit / quota exceeded.
Implementations§
Source§impl AppError
impl AppError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is transient and retrying with a fallback provider may succeed (timeout, rate limit, 5xx upstream).
Sourcepub fn status_code(&self) -> u16
pub fn status_code(&self) -> u16
HTTP status code as u16 (no axum dependency).
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
1.30.0 · 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<QuotaExceeded> for AppError
impl From<QuotaExceeded> for AppError
Source§fn from(exceeded: QuotaExceeded) -> Self
fn from(exceeded: QuotaExceeded) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AppError
impl RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppError
impl UnwindSafe for AppError
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