Merge pull request #49 from crosbymichael/status

Handle ok status
This commit is contained in:
Phil Estes 2019-08-28 13:29:38 -04:00 committed by GitHub
commit 92c8520ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -134,10 +135,9 @@ func (c *Client) Call(ctx context.Context, service, method string, req, resp int
return err return err
} }
if cresp.Status != nil { if cresp.Status != nil && cresp.Status.Code != int32(codes.OK) {
return status.ErrorProto(cresp.Status) return status.ErrorProto(cresp.Status)
} }
return nil return nil
} }