From b551e8bcc63900eee1052499b00e9eb2fce71d77 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Sat, 21 Sep 2019 23:11:17 +0300 Subject: Fix error on timeout --- client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client.go b/client.go index 83551fb..14f7129 100644 --- a/client.go +++ b/client.go @@ -41,6 +41,12 @@ func (cl *client) requestReader(method, path string, query url.Values, body io.R } resp, err := cl.httpClient.Do(req) if err != nil { + err, ok := err.(*url.Error) + if ok { + if err.Timeout() { + return nil, nil + } + } return nil, err } if resp.StatusCode != http.StatusOK { -- cgit v1.2.3