From e768ef944c88be1b18c995544c76fa931d9c5916 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Sun, 14 Feb 2021 13:21:37 +0300 Subject: Fix issue #3 --- client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client.go') diff --git a/client.go b/client.go index 14f7129..0610e22 100644 --- a/client.go +++ b/client.go @@ -3,6 +3,7 @@ package tamtam import ( "bytes" "encoding/json" + "errors" "io" "net/http" "net/url" @@ -10,6 +11,10 @@ import ( "github.com/neonxp/tamtam/schemes" ) +var ( + errLongPollTimeout = errors.New("timeout") +) + type client struct { key string version string @@ -44,7 +49,7 @@ func (cl *client) requestReader(method, path string, query url.Values, body io.R err, ok := err.(*url.Error) if ok { if err.Timeout() { - return nil, nil + return nil, errLongPollTimeout } } return nil, err -- cgit v1.2.3