Client.Call(): do not return error if no Status is set (gRPC v1.23 and up)
To account for 5da5b1f225
,
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>
This commit is contained in:
parent
f969a7f076
commit
17f4d32234
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user