Handle ok status
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
9abb3e2680
commit
0e0f228740
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user