From 8e11f2df18b38b606666335372d0c1a8e6fe70f7 Mon Sep 17 00:00:00 2001 From: Varun Dhananjaya Date: Fri, 23 Jun 2023 02:11:44 -0400 Subject: [PATCH] [keyserver] improve error messages in rust-node-addon Summary: add a more detailed message in case an error is caught. Depends on D8298 Test Plan: ran keyserver but not identity service to get errors connecting to identity. saw better error logs Reviewers: jon, bartek Reviewed By: jon Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D8299 --- .../src/identity_client/add_reserved_username.rs | 2 +- .../src/identity_client/remove_reserved_username.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_username.rs b/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_username.rs index 8e6d6cfaac..f301f567ab 100644 --- a/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_username.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/add_reserved_username.rs @@ -16,7 +16,7 @@ pub async fn add_reserved_username( identity_client .add_reserved_username(add_reserved_username_request) .await - .map_err(|_| Error::from_status(Status::GenericFailure))? + .map_err(|e| Error::new(Status::GenericFailure, e.to_string()))? .into_inner(); Ok(()) diff --git a/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_username.rs b/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_username.rs index c15e2b3a42..c9a3c03303 100644 --- a/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_username.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/remove_reserved_username.rs @@ -16,7 +16,7 @@ pub async fn remove_reserved_username( identity_client .remove_reserved_username(remove_reserved_username_request) .await - .map_err(|_| Error::from_status(Status::GenericFailure))? + .map_err(|e| Error::new(Status::GenericFailure, e.to_string()))? .into_inner(); Ok(())