Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Log missing Err(_) for GCP and metrics #295

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions mpc-recovery/src/leader_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}
}
}

Expand Down
11 changes: 7 additions & 4 deletions mpc-recovery/src/sign_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
)
}
}
}

Expand Down
Loading