From 80eb55eac34922e6624aee75f98d106190de56da Mon Sep 17 00:00:00 2001 From: cong-or Date: Mon, 13 Jan 2025 15:17:26 +0000 Subject: [PATCH] refactor(improved error handling): bubble up rather than log --- .../queries/registrations/get_all_stakes_and_vote_keys.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/catalyst-gateway/bin/src/db/index/queries/registrations/get_all_stakes_and_vote_keys.rs b/catalyst-gateway/bin/src/db/index/queries/registrations/get_all_stakes_and_vote_keys.rs index d3593872942..2143cdedd48 100644 --- a/catalyst-gateway/bin/src/db/index/queries/registrations/get_all_stakes_and_vote_keys.rs +++ b/catalyst-gateway/bin/src/db/index/queries/registrations/get_all_stakes_and_vote_keys.rs @@ -42,11 +42,9 @@ impl GetAllStakesAndVoteKeysQuery { ) .await; - if let Err(ref error) = get_all_stake_and_vote_keys { - error!(error=%error, "Failed to prepare get all (stake addrs, vote_keys)"); - }; - - get_all_stake_and_vote_keys + get_all_stake_and_vote_keys.inspect_err( + |error| error!(error=%error, "Failed to prepare get all (stake addrs, vote_keys)"), + ) } /// Executes get all `stake_addr` paired with vote keys [(`stake_addr,vote_key`)]