Skip to content

Commit

Permalink
Client.Call(): do not return error if no Status is set (gRPC v1.23 an…
Browse files Browse the repository at this point in the history
…d up)

To account for grpc/grpc-go@5da5b1f,
which is part of gRPC v1.23.0 and up, and after which gRPC no longer sets a
Status if no error occured.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Aug 26, 2019
1 parent f969a7f commit 17f4d32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ func (c *Client) Call(ctx context.Context, service, method string, req, resp int
return err
}

if cresp.Status == nil {
return errors.New("no status provided on response")
if cresp.Status != nil {
return status.ErrorProto(cresp.Status)
}

return status.ErrorProto(cresp.Status)
return nil
}

func (c *Client) dispatch(ctx context.Context, req *Request, resp *Response) error {
Expand Down

0 comments on commit 17f4d32

Please sign in to comment.