auth0_integration/error.rs
1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum AppError {
5 #[error("Configuration error: {0}")]
6 Config(String),
7
8 #[error("Auth0 error: {0}")]
9 Auth0(String),
10
11 #[error("Invalid token: {0}")]
12 InvalidToken(String),
13
14 #[error("Unauthorized")]
15 Unauthorized,
16
17 #[error("HTTP error: {0}")]
18 Http(#[from] reqwest::Error),
19
20 #[error("JWT error: {0}")]
21 Jwt(#[from] jsonwebtoken::errors::Error),
22}