From 8e188bbfc25d9932274cb46635fe217061928d06 Mon Sep 17 00:00:00 2001 From: Diego Date: Thu, 19 Sep 2024 10:45:58 -0300 Subject: [PATCH] Change error comparission --- dot/network/warp_sync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dot/network/warp_sync.go b/dot/network/warp_sync.go index f65dd16095..18d972dcf6 100644 --- a/dot/network/warp_sync.go +++ b/dot/network/warp_sync.go @@ -4,6 +4,8 @@ package network import ( + "errors" + "github.com/ChainSafe/gossamer/dot/network/messages" "github.com/ChainSafe/gossamer/lib/common" libp2pnetwork "github.com/libp2p/go-libp2p/core/network" @@ -48,7 +50,7 @@ func (s *Service) handleWarpSyncMessage(stream libp2pnetwork.Stream, msg message defer func() { err := stream.Close() - if err != nil && err.Error() != ErrStreamReset.Error() { + if err != nil && errors.Is(err, ErrStreamReset) { logger.Warnf("failed to close stream: %s", err) } }()