idk
All checks were successful
/ upload (release) Successful in 1m3s

This commit is contained in:
pavel 2026-02-16 23:58:08 +01:00
commit 6f55ad839c
14 changed files with 865 additions and 72 deletions

20
src/middleware.rs Normal file
View file

@ -0,0 +1,20 @@
use axum::{body::Body, extract::Request, middleware::Next, response::Response};
use tracing::error;
pub async fn log_errors(req: Request<Body>, next: Next) -> Response {
let method = req.method().clone();
let uri = req.uri().clone();
let response = next.run(req).await;
if response.status().is_client_error() || response.status().is_server_error() {
error!(
method = ?method,
uri = ?uri,
status = ?response.status(),
"Error response returned"
);
}
response
}