Skip to content

Commit

Permalink
Change error comparission
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Sep 19, 2024
1 parent 8be071e commit 8e188bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dot/network/warp_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
}()
Expand Down

0 comments on commit 8e188bb

Please sign in to comment.