From 487d97cb019ef1a37d3ef90c6b051ba0389c6d15 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 28 Jan 2023 11:52:32 -0500 Subject: tracing --- src/types/extract.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/types/extract.rs') diff --git a/src/types/extract.rs b/src/types/extract.rs index 399fe67..69c6ed8 100644 --- a/src/types/extract.rs +++ b/src/types/extract.rs @@ -27,6 +27,7 @@ impl FromRequestParts for AuthorizedUser where S: Send + Sync { }; let Ok(user) = User::from_user_id(session.user_id, true) else { + tracing::error!("Valid token but no valid user"); return Err(ResponseCode::InternalServerError.text("Valid token but no valid user")) }; @@ -84,6 +85,7 @@ impl FromRequest for Json where async fn from_request(mut req: Request, state: &S) -> Result { let Ok(ConnectInfo(info)) = req.extract_parts::>().await else { + tracing::error!("Failed to read connection info"); return Err(ResponseCode::InternalServerError.text("Failed to read connection info")); }; let method = req.method().clone(); @@ -91,6 +93,7 @@ impl FromRequest for Json where let uri = req.uri().clone(); let Ok(bytes) = Bytes::from_request(req, state).await else { + tracing::error!("Failed to read request body"); return Err(ResponseCode::InternalServerError.text("Failed to read request body")); }; -- cgit v1.2.3-freya