Skip to content

Commit

Permalink
chore: add original ban message to error (tari-project#5718)
Browse files Browse the repository at this point in the history
Description
---
Display the original error in the fail to ban error messages
  • Loading branch information
stringhandler authored Sep 1, 2023
1 parent c66af69 commit 5ebeab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comms/core/src/connection_manager/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ async fn maybe_ban<T, E: ToString + Into<ConnectionManagerError>>(
err: E,
) -> Result<T, ConnectionManagerError> {
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());
}
}

Expand Down

0 comments on commit 5ebeab1

Please sign in to comment.