From a1501662db3fd4a6c7e605a018dae68bc1cda52f Mon Sep 17 00:00:00 2001 From: Phuong Nguyen Date: Tue, 19 Sep 2023 17:13:54 -0700 Subject: [PATCH] Log missing Err(_) --- mpc-recovery/src/leader_node/mod.rs | 11 +++++++---- mpc-recovery/src/sign_node/mod.rs | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mpc-recovery/src/leader_node/mod.rs b/mpc-recovery/src/leader_node/mod.rs index 2d484b04c..9a0c68120 100644 --- a/mpc-recovery/src/leader_node/mod.rs +++ b/mpc-recovery/src/leader_node/mod.rs @@ -196,10 +196,13 @@ async fn metrics() -> (StatusCode, String) { match grab_metrics() { Ok(response) => (StatusCode::OK, response), - Err(_) => ( - StatusCode::INTERNAL_SERVER_ERROR, - "failed to generate prometheus metrics".to_string(), - ), + Err(err) => { + tracing::error!("failed to generate prometheus metrics: {err}"); + ( + StatusCode::INTERNAL_SERVER_ERROR, + "failed to generate prometheus metrics".to_string(), + ) + } } } diff --git a/mpc-recovery/src/sign_node/mod.rs b/mpc-recovery/src/sign_node/mod.rs index 4555d8ced..eb45f54a2 100644 --- a/mpc-recovery/src/sign_node/mod.rs +++ b/mpc-recovery/src/sign_node/mod.rs @@ -515,10 +515,13 @@ async fn accept_pk_set( StatusCode::OK, Json(Ok("Successfully set node public keys".to_string())), ), - Err(_) => ( - StatusCode::INTERNAL_SERVER_ERROR, - Json(Ok("failed to save the keys".to_string())), - ), + Err(err) => { + tracing::error!("Failed to save pk set due to GCP error: {err}"); + ( + StatusCode::INTERNAL_SERVER_ERROR, + Json(Ok("failed to save node public keys".to_string())), + ) + } } }