use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum AppError {
#[error("validation error: {code}")]
Validation {
code: &'static str,
},
#[error("forbidden by policy: {policy}")]
Forbidden {
policy: &'static str,
},
#[error("not found")]
NotFound,
#[error("conflict")]
Conflict,
#[error("dependency '{dep}' unavailable")]
Dependency {
dep: &'static str,
},
#[error("cryptographic operation failed")]
Crypto,
#[error("internal error")]
Internal,
#[error("rate limit exceeded")]
RateLimit {
retry_after_seconds: Option<u64>,
},
}