acton_htmx/error/
mod.rs

1//! Error types and error handling
2
3#![allow(dead_code)]
4
5use thiserror::Error;
6
7/// Framework error type
8#[derive(Debug, Error)]
9pub enum ActonHtmxError {
10    /// Configuration error
11    #[error("Configuration error: {0}")]
12    Config(String),
13
14    /// Bad request error
15    #[error("Bad request: {0}")]
16    BadRequest(String),
17
18    /// Server error
19    #[error("Server error: {0}")]
20    ServerError(String),
21
22    /// Database error
23    #[error("Database error: {0}")]
24    Database(#[from] sqlx::Error),
25
26    /// OAuth2 error
27    #[error("OAuth2 error: {0}")]
28    OAuth(#[from] crate::oauth2::types::OAuthError),
29
30    /// Session error
31    #[error("Session error: {0}")]
32    SessionError(#[from] crate::auth::SessionError),
33
34    /// Unauthorized (401)
35    #[error("Unauthorized: {0}")]
36    Unauthorized(String),
37
38    /// Forbidden (403)
39    #[error("Forbidden: {0}")]
40    Forbidden(String),
41
42    /// Not Found (404)
43    #[error("Not found: {0}")]
44    NotFound(String),
45}