From 0e0f228740de8ef098d18c490be48c364b3dda05 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 28 Aug 2019 11:45:14 -0400 Subject: [PATCH] Handle ok status Signed-off-by: Michael Crosby --- client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index bdc01b5..bdd1d12 100644 --- a/client.go +++ b/client.go @@ -29,6 +29,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/pkg/errors" "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -134,10 +135,9 @@ func (c *Client) Call(ctx context.Context, service, method string, req, resp int return err } - if cresp.Status != nil { + if cresp.Status != nil && cresp.Status.Code != int32(codes.OK) { return status.ErrorProto(cresp.Status) } - return nil }