Skip to content

Commit

Permalink
Merge pull request #49 from crosbymichael/status
Browse files Browse the repository at this point in the history
Handle ok status
  • Loading branch information
estesp authored Aug 28, 2019
2 parents 9abb3e2 + 0e0f228 commit 92c8520
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 92c8520

Please sign in to comment.