Skip to content

Commit

Permalink
feat: use utils.Wrap1 to srround ret err
Browse files Browse the repository at this point in the history
  • Loading branch information
CNCSMonster committed Sep 19, 2023
1 parent c64ce8a commit c1fd5b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/common/chatrpcstart/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(c
zkClient.AddOption(chatMw.AddUserType(), mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()))
registerIP, err := network.GetRpcRegisterIP(config.Config.Rpc.RegisterIP)
if err != nil {
return err
return utils.Wrap1(err)
}
srv := grpc.NewServer(append(options, mw.GrpcServer())...)
defer srv.GracefulStop()
Expand All @@ -60,7 +60,7 @@ func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(c
}
listener, err := net.Listen("tcp", net.JoinHostPort(network.GetListenIP(config.Config.Rpc.ListenIP), strconv.Itoa(rpcPort)))
if err != nil {
return err
return utils.Wrap1(err)
}
defer listener.Close()
return utils.Wrap1(srv.Serve(listener))
Expand Down

0 comments on commit c1fd5b4

Please sign in to comment.