Merge pull request #33 from JoeWrightss/patch-1
Fix returns error message
This commit is contained in:
commit
6914432707
@ -255,7 +255,7 @@ func (c *Client) recv(resp *Response, msg *message) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if msg.Type != messageTypeResponse {
|
if msg.Type != messageTypeResponse {
|
||||||
return errors.New("unkown message type received")
|
return errors.New("unknown message type received")
|
||||||
}
|
}
|
||||||
|
|
||||||
defer c.channel.putmbuf(msg.p)
|
defer c.channel.putmbuf(msg.p)
|
||||||
|
@ -76,7 +76,7 @@ func (s *serviceSet) dispatch(ctx context.Context, serviceName, methodName strin
|
|||||||
switch v := obj.(type) {
|
switch v := obj.(type) {
|
||||||
case proto.Message:
|
case proto.Message:
|
||||||
if err := proto.Unmarshal(p, v); err != nil {
|
if err := proto.Unmarshal(p, v); err != nil {
|
||||||
return status.Errorf(codes.Internal, "ttrpc: error unmarshaling payload: %v", err.Error())
|
return status.Errorf(codes.Internal, "ttrpc: error unmarshalling payload: %v", err.Error())
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return status.Errorf(codes.Internal, "ttrpc: error unsupported request type: %T", v)
|
return status.Errorf(codes.Internal, "ttrpc: error unsupported request type: %T", v)
|
||||||
|
Loading…
Reference in New Issue
Block a user