Skip to content

Commit

Permalink
fix: remove panic on grpc close error
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Mar 16, 2023
1 parent 728f10b commit 6ded8b1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ func NewClientFromService(ctx context.Context, s *grpc.Server, svc Service, opts

protocoltypes.RegisterProtocolServiceServer(s, svc)
go func() {
switch err := s.Serve(bl); err {
case nil, grpc.ErrServerStopped: // ok
default:
panic(err)
}
// we dont need to log the error
_ = s.Serve(bl)
}()

return &client{
Expand Down

0 comments on commit 6ded8b1

Please sign in to comment.