aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-09-21 23:11:17 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-09-21 23:11:17 +0300
commitb551e8bcc63900eee1052499b00e9eb2fce71d77 (patch)
tree93f3267801efaf50771951be1ee4d556ed24f7b1
parent33e153398fc9fb027146ae7a7d9887ffc6d9348d (diff)
Fix error on timeoutv0.3.2
-rw-r--r--client.go6
1 files changed, 6 insertions, 0 deletions
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 {