Commit b541921b authored by Rob Pike's avatar Rob Pike

gob: bug fix: errors encoding the payload were not

returned to caller.

R=rsc
CC=golang-dev
https://golang.org/cl/1164041
parent 56c5710b
......@@ -173,8 +173,12 @@ func (enc *Encoder) Encode(e interface{}) os.Error {
encodeInt(enc.state, int64(enc.sent[rt]))
// Encode the object.
encode(enc.state.b, e)
enc.send()
err := encode(enc.state.b, e)
if err != nil {
enc.setError(err)
} else {
enc.send()
}
return enc.state.err
}
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