feat: Add a panic handler and clean up error page

This commit is contained in:
Ginger
2026-03-18 13:43:34 -04:00
parent 50c94d85a1
commit 728c5828ba
5 changed files with 48 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
use std::convert::Infallible;
use axum::{Router, routing::get};
use conduwuit_core::Error;
use crate::WebError;
pub(crate) fn build() -> Router<crate::State> {
Router::new()
.route("/_debug/panic", get(async || -> Infallible { panic!("Guru meditation error") }))
.route(
"/_debug/error",
get(async || -> WebError {
Error::Err(std::borrow::Cow::Borrowed("Guru meditation error")).into()
}),
)
}