feat: add CatchPanicLayer
This commit is contained in:
@@ -4,6 +4,7 @@ use anyhow::Context;
|
||||
use axum::handler::Handler;
|
||||
use axum::{Router, routing::any};
|
||||
use dotenvy::dotenv;
|
||||
use tower_http::catch_panic::CatchPanicLayer;
|
||||
use tower_http::compression::CompressionLayer;
|
||||
use tracing::{error, info, level_filters::LevelFilter};
|
||||
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
|
||||
@@ -89,6 +90,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
any(proxy::proxy_handler.layer(proxy_middleware)),
|
||||
)
|
||||
.layer(CompressionLayer::new().gzip(true))
|
||||
.layer(CatchPanicLayer::new())
|
||||
.with_state(ctx);
|
||||
|
||||
// Run the server
|
||||
|
||||
Reference in New Issue
Block a user