修复RPC使用protobuf不能正常返回

This commit is contained in:
lifeiyi
2020-07-08 17:11:27 +08:00
parent 825c61e626
commit a69010c31d

View File

@@ -17,7 +17,9 @@ func (slf *PBRpcRequestData) MakeRequest(seq uint64,serviceMethod string,noReply
func (slf *PBRpcResponseData) MakeRespone(seq uint64,err *RpcError,reply []byte) *PBRpcResponseData{
slf.Seq = proto.Uint64(seq)
slf.Error = proto.String(err.Error())
if err != nil {
slf.Error = proto.String(err.Error())
}
slf.Reply = reply
return slf
@@ -45,6 +47,9 @@ func (slf *PBRpcRequestData) IsReply() bool{
}
func (slf *PBRpcResponseData) GetErr() *RpcError {
if slf.GetError() == "" {
return nil
}
return Errorf(slf.GetError())
}