ing
This commit is contained in:
parent
318a547d8b
commit
74d68de28f
|
@ -110,8 +110,11 @@ func (c *Client) CallTimeout(timeout time.Duration, result interface{}, method s
|
|||
|
||||
select {
|
||||
case <-rs.doneChan:
|
||||
if nil != rs.clientError {
|
||||
return rs.clientError
|
||||
}
|
||||
result = rs.result
|
||||
return rs.clientError
|
||||
return nil
|
||||
case <-t.C:
|
||||
rs.cancel()
|
||||
return newError(method, params, fmt.Errorf("%s Timeout", c.logHeader()))
|
||||
|
@ -304,10 +307,13 @@ func (c *Client) handleResponse(resCodec protocol.ClientResponseCodec) {
|
|||
return
|
||||
}
|
||||
rs := _rs.(*requestState)
|
||||
rs.setError(resCodec.Error())
|
||||
err := resCodec.Result(rs.result)
|
||||
if nil != err {
|
||||
rs.setError(err)
|
||||
if nil != resCodec.Error() {
|
||||
rs.setError(resCodec.Error())
|
||||
} else {
|
||||
err := resCodec.Result(rs.result)
|
||||
if nil != err {
|
||||
rs.setError(err)
|
||||
}
|
||||
}
|
||||
|
||||
rs.done()
|
||||
|
|
Loading…
Reference in New Issue
Block a user