Commit 2bf8741c authored by Rob Pike's avatar Rob Pike

rpc: catch errors from ReadResponseBody.

Fixes #1014.

R=rsc
CC=golang-dev
https://golang.org/cl/1941041
parent b0d0de59
...@@ -94,10 +94,12 @@ func (client *Client) input() { ...@@ -94,10 +94,12 @@ func (client *Client) input() {
client.pending[seq] = c, false client.pending[seq] = c, false
client.mutex.Unlock() client.mutex.Unlock()
err = client.codec.ReadResponseBody(c.Reply) err = client.codec.ReadResponseBody(c.Reply)
// Empty strings should turn into nil os.Errors
if response.Error != "" { if response.Error != "" {
c.Error = os.ErrorString(response.Error) c.Error = os.ErrorString(response.Error)
} else if err != nil {
c.Error = err
} else { } else {
// Empty strings should turn into nil os.Errors
c.Error = nil c.Error = nil
} }
// We don't want to block here. It is the caller's responsibility to make // We don't want to block here. It is the caller's responsibility to make
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment