From ad03390fedc85714c056a711056419e942c05c2e Mon Sep 17 00:00:00 2001 From: Victor Ermolaev Date: Fri, 10 Mar 2023 13:47:39 +0100 Subject: [PATCH] Print error chain for `ConnectionHandlerUpgrErr` --- swarm/src/handler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swarm/src/handler.rs b/swarm/src/handler.rs index cf8b9c1f2cb9..f48021a57979 100644 --- a/swarm/src/handler.rs +++ b/swarm/src/handler.rs @@ -457,7 +457,7 @@ impl ConnectionHandlerUpgrErr { impl fmt::Display for ConnectionHandlerUpgrErr where - TUpgrErr: fmt::Display, + TUpgrErr: error::Error + 'static, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -467,7 +467,7 @@ where ConnectionHandlerUpgrErr::Timer => { write!(f, "Timer error while opening a substream") } - ConnectionHandlerUpgrErr::Upgrade(err) => write!(f, "{err}"), + err @ ConnectionHandlerUpgrErr::Upgrade(_) => crate::print_error_chain(f, err), } } }