check for slightly fewer errors

json.Decoder.Decode() can yield io.EOF which is not actually an
error. This appears to have caused a number of indirect test failures
by making ImportRoaring generally report failure.
This commit is contained in:
Seebs 2019-04-01 15:56:14 -05:00
parent d5907b2a2e
commit 2c6eb66895

View file

@ -630,7 +630,8 @@ func (c *InternalClient) ImportRoaring(ctx context.Context, uri *pilosa.URI, ind
dec := json.NewDecoder(resp.Body)
rbody := &pilosa.ImportResponse{}
err = dec.Decode(rbody)
if err != nil {
// Decode can return EOF when no error occurred. helpful!
if err != nil && err != io.EOF {
return errors.Wrap(err, "decoding response body")
}
if rbody.Err != "" {