From 2c6eb6689588d256407bef51cc0103023060edd8 Mon Sep 17 00:00:00 2001 From: Seebs Date: Mon, 1 Apr 2019 15:56:14 -0500 Subject: [PATCH] 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. --- http/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http/client.go b/http/client.go index f8ad7cb37..4f2f1c208 100644 --- a/http/client.go +++ b/http/client.go @@ -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 != "" {