mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
修复RPC使用protobuf不能正常返回
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user