*: replace deprecated grpc.Errorf calls with status.Errorf (#1651)

This commit is contained in:
Gyu-Ho Lee
2017-11-06 10:24:20 -08:00
committed by dfawley
parent 4318e6475c
commit 865013bc17
10 changed files with 72 additions and 64 deletions

View File

@ -38,6 +38,7 @@ import (
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/interop"
testpb "google.golang.org/grpc/interop/grpc_testing"
"google.golang.org/grpc/status"
metricspb "google.golang.org/grpc/stress/grpc_testing"
"google.golang.org/grpc/testdata"
)
@ -176,7 +177,7 @@ func (s *server) GetGauge(ctx context.Context, in *metricspb.GaugeRequest) (*met
if g, ok := s.gauges[in.Name]; ok {
return &metricspb.GaugeResponse{Name: in.Name, Value: &metricspb.GaugeResponse_LongValue{LongValue: g.get()}}, nil
}
return nil, grpc.Errorf(codes.InvalidArgument, "gauge with name %s not found", in.Name)
return nil, status.Errorf(codes.InvalidArgument, "gauge with name %s not found", in.Name)
}
// createGauge creates a gauge using the given name in metrics server.