Skip to content

Commit 01c4d61

Browse files
committed
no wrap nil errors
1 parent 56023ac commit 01c4d61

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

internal/conn/conn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ func (c *conn) NewStream(
447447
}
448448

449449
func (c *conn) wrapError(err error) error {
450+
if err == nil {
451+
return nil
452+
}
450453
nodeErr := newNodeError(c.endpoint.NodeID(), c.endpoint.Address(), err)
451454
return xerrors.WithStackTrace(nodeErr, xerrors.WithSkipDepth(1))
452455
}

internal/conn/grpc_client_stream.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ func (s *grpcClientStream) RecvMsg(m interface{}) (err error) {
125125
}
126126

127127
func (s *grpcClientStream) wrapError(err error) error {
128+
if err == nil {
129+
return nil
130+
}
131+
128132
nodeErr := newNodeError(s.c.endpoint.NodeID(), s.c.endpoint.Address(), err)
129133
return xerrors.WithStackTrace(nodeErr, xerrors.WithSkipDepth(1))
130134
}

0 commit comments

Comments
 (0)