From 27b6889a8b4d4bab4c45f9f8d0f95dc4a54d3709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Fri, 28 Jul 2023 21:58:54 +0200 Subject: [PATCH] Update index.rs --- src/routes/index.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/routes/index.rs b/src/routes/index.rs index 595f5d8..c8c021a 100644 --- a/src/routes/index.rs +++ b/src/routes/index.rs @@ -29,14 +29,22 @@ pub async fn index(session: Session, data: web::Data) -> Result) -> Result { let body = data.get_ref().tera .render("not_found.html", &Context::new()) - .map_err(|_| error::ErrorInternalServerError("Template error"))?; + .map_err(|e| { + #[cfg(enable_tracing)] + tracing::warn!("{}", e); + error::ErrorInternalServerError("Template error") + })?; Ok(HttpResponse::NotFound().content_type("text/html").body(body)) }