Skip to content

Commit

Permalink
fix: improve EOF detection
Browse files Browse the repository at this point in the history
  • Loading branch information
powerman committed Apr 23, 2020
1 parent c2902e8 commit 6f3efa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonrpc2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *clientCodec) ReadResponseHeader(r *rpc.Response) error {
// - client will be shutdown
// So, return io.EOF as is, return *Error for all other errors.
if err := c.dec.Decode(&c.resp); err != nil {
if err == io.EOF {
if err == io.EOF || err == io.ErrUnexpectedEOF {
return err
}
return NewError(errInternal.Code, err.Error())
Expand Down

0 comments on commit 6f3efa7

Please sign in to comment.