mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
自定义rpc错误类型
This commit is contained in:
@@ -130,7 +130,7 @@ func (slf *Client) Go(noReply bool,mutiCoroutine bool,serviceMethod string, args
|
||||
return call
|
||||
}
|
||||
|
||||
type RequestHandler func(Returns interface{},Err error)
|
||||
type RequestHandler func(Returns interface{},Err *RpcError)
|
||||
|
||||
type RpcRequest struct {
|
||||
//packhead
|
||||
@@ -151,7 +151,7 @@ type RpcRequest struct {
|
||||
type RpcResponse struct {
|
||||
//head
|
||||
Seq uint64 // sequence number chosen by client
|
||||
Err error
|
||||
Err *RpcError
|
||||
|
||||
//returns
|
||||
Returns []byte
|
||||
@@ -189,6 +189,9 @@ func (slf *Client) Run(){
|
||||
v.Err = err
|
||||
}
|
||||
}
|
||||
if respone.Err != nil {
|
||||
v.Err= respone.Err
|
||||
}
|
||||
|
||||
|
||||
if v.callback.IsValid() {
|
||||
|
||||
Reference in New Issue
Block a user