From 685ce2ac95417bb4f72078398a15a4addcbc4990 Mon Sep 17 00:00:00 2001 From: progre Date: Sun, 26 Nov 2023 18:17:38 +0900 Subject: [PATCH] feat(junowen-server): add fatal error log --- junowen-server/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/junowen-server/src/main.rs b/junowen-server/src/main.rs index c5a4745..6657544 100644 --- a/junowen-server/src/main.rs +++ b/junowen-server/src/main.rs @@ -40,12 +40,16 @@ mod local { mod lambda { use lambda_http::{service_fn, IntoResponse, Request}; + use tracing::error; use crate::{database, routes::routes, tracing_helper}; async fn func(req: Request) -> Result { let db = database::DynamoDB::new().await; - routes(&req, &db).await + routes(&req, &db).await.map_err(|err| { + error!("Fatal error: {:?}", err); + err + }) } #[allow(unused)]