]> Cypherpunks repositories - gostls13.git/commit
Make non-errored RPC calls return 'nil' error to caller.
authorAron Nopanen <aron.nopanen@gmail.com>
Tue, 17 Nov 2009 19:29:02 +0000 (11:29 -0800)
committerRob Pike <r@golang.org>
Tue, 17 Nov 2009 19:29:02 +0000 (11:29 -0800)
commitc51ee432d16ec7f0e67f2a62e457f58f86d5a708
tree4d2ce7c5275505350a96e3ced62764a027bae7cd
parent3f00205a0a65b619f2f64818f986e83184083609
Make non-errored RPC calls return 'nil' error to caller.

Error information is carried from RPC server to client in the string
'Error' field of rpc.Response. An empty string is sent in the success
case. This empty string was being returned to the caller (of Client.Call
or Client.Go), resulting in a non-nil error response.

This change detects an empty-string Response.Error at the client, and
translates it into a nil value in Call.Error.

Tests updated to check error return in success cases.

R=r, rsc
https://golang.org/cl/154159
src/pkg/rpc/server_test.go