From aa855db08304f10120246d7c0b1db3e11fccb455 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 12 Feb 2024 17:07:00 -0500 Subject: [PATCH] fix: use common log for HTTP errors --- .../public_http_server/handlers/relay_webhook/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/public_http_server/handlers/relay_webhook/mod.rs b/src/services/public_http_server/handlers/relay_webhook/mod.rs index e3d8c675..951ccaca 100644 --- a/src/services/public_http_server/handlers/relay_webhook/mod.rs +++ b/src/services/public_http_server/handlers/relay_webhook/mod.rs @@ -68,11 +68,12 @@ pub enum Error { ServerError(RelayMessageServerError), } +// TODO consider using unified error.rs for sharing warn vs error prefixes (i.e. HTTP server error) impl IntoResponse for Error { fn into_response(self) -> Response { match self { Error::ClientError(e) => { - warn!("Relay webhook client error: {e:?}"); + warn!("HTTP client error: Relay webhook client error: {e:?}"); ( StatusCode::UNPROCESSABLE_ENTITY, Json(json!({ "error": e.to_string() })), @@ -80,7 +81,7 @@ impl IntoResponse for Error { .into_response() } Error::ServerError(e) => { - error!("Relay webhook server error: {e:?}"); + error!("HTTP server error: Relay webhook server error: {e:?}"); ( StatusCode::INTERNAL_SERVER_ERROR, Json(json!({ "error": "Internal server error" })),