From bf4959a8ba2e4da63e9793d3331ac8e04f5888d0 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Mon, 15 Feb 2021 19:18:21 -0500 Subject: [PATCH] Return ErrInvalidResponse on error reading status Return ErrInvalidResponse when unable to read the response status code instead of returning the error from strconv. --- response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/response.go b/response.go index b6110d6..c608bb1 100644 --- a/response.go +++ b/response.go @@ -51,7 +51,7 @@ func ReadResponse(rc io.ReadCloser) (*Response, error) { } status, err := strconv.Atoi(string(statusB)) if err != nil { - return nil, err + return nil, ErrInvalidResponse } resp.Status = status