Parent
[>]
1//! Application error types and HTTP response rendering. 2//! 3//! Defines the unified [`Error`] enum used across all handlers and the 4//! [`Result`] type alias. `Error` implements [`IntoResponse`] via askama's 5//! `error.html` template. 6 7use ; 8 9use Template; 10use ; 11use ; 12use Error; 13 14use crateSiteConfig; 15 16/// Unified error type for the application. 17/// 18/// Each variant maps to an HTTP status code and a rendered error page. 19 20 32 33/// Convenience alias for `std::result::Result<T, Error>`. 34pub type Result<T> = Result; 35 36/// Module-level [`SiteConfig`] used only by the error template renderer. 37/// 38/// Set once during startup in [`init_site`]. This exists because 39/// [`Error::into_response`] does not have access to [`axum::extract::State`] 40/// — it runs after the handler has returned. All other code paths read from 41/// [`AppState`](crate::routes::AppState). 42static SITE: = new; 43 44/// Stores the [`SiteConfig`] for use by the error template. 45/// 46/// Called once from `main` before the server starts. 47 50 51 65 66 67 68 74 75