diff options
author | Rob Pike <r@golang.org> | 2010-08-10 16:55:02 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2010-08-10 16:55:02 -0700 |
commit | 2bf8741c0f87bfe0c9b22718c3cd64fc6228ab42 (patch) | |
tree | 1ba28e0c005116e776678db5777323a8a0656564 | |
parent | b0d0de59a12e48b1875d7b0fcaa9e4bc3fc04d35 (diff) | |
download | go-2bf8741c0f87bfe0c9b22718c3cd64fc6228ab42.tar.gz go-2bf8741c0f87bfe0c9b22718c3cd64fc6228ab42.zip |
rpc: catch errors from ReadResponseBody.
Fixes #1014.
R=rsc
CC=golang-dev
https://golang.org/cl/1941041
-rw-r--r-- | src/pkg/rpc/client.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/rpc/client.go b/src/pkg/rpc/client.go index d742d099fb..50b8838358 100644 --- a/src/pkg/rpc/client.go +++ b/src/pkg/rpc/client.go @@ -94,10 +94,12 @@ func (client *Client) input() { client.pending[seq] = c, false client.mutex.Unlock() err = client.codec.ReadResponseBody(c.Reply) - // Empty strings should turn into nil os.Errors if response.Error != "" { c.Error = os.ErrorString(response.Error) + } else if err != nil { + c.Error = err } else { + // Empty strings should turn into nil os.Errors c.Error = nil } // We don't want to block here. It is the caller's responsibility to make |