Skip to content

Commit

Permalink
feat(junowen-server): add fatal error log
Browse files Browse the repository at this point in the history
  • Loading branch information
progre committed Nov 26, 2023
1 parent 7577e30 commit 685ce2a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion junowen-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<impl IntoResponse, anyhow::Error> {
let db = database::DynamoDB::new().await;
routes(&req, &db).await
routes(&req, &db).await.map_err(|err| {
error!("Fatal error: {:?}", err);
err
})
}

#[allow(unused)]
Expand Down

0 comments on commit 685ce2a

Please sign in to comment.