From 5ebeab1a13217594680033bcdf96fd808d904e67 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Fri, 1 Sep 2023 16:53:52 +0200 Subject: [PATCH] chore: add original ban message to error (#5718) Description --- Display the original error in the fail to ban error messages --- comms/core/src/connection_manager/common.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comms/core/src/connection_manager/common.rs b/comms/core/src/connection_manager/common.rs index 22ff811d99..70c21acf86 100644 --- a/comms/core/src/connection_manager/common.rs +++ b/comms/core/src/connection_manager/common.rs @@ -271,11 +271,11 @@ async fn maybe_ban>( err: E, ) -> Result { if let Some(ban_duration) = ban_duration { - if let Err(err) = peer_manager + if let Err(pe) = peer_manager .ban_peer(authenticated_public_key, ban_duration, err.to_string()) .await { - error!(target: LOG_TARGET, "Failed to ban peer due to internal error: {}", err); + error!(target: LOG_TARGET, "Failed to ban peer due to internal error: {}. Original ban error: {}", pe, err.to_string()); } }