diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2021-02-14 13:23:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 13:23:10 +0300 |
commit | c31a53b6a1e5fa0c6966451c5f45e42d1eb822ee (patch) | |
tree | 5d1683dbe87fedbc6c1d7376df7147a8ad0936c2 /client.go | |
parent | ee63b08bd7861702123f9c5e83d60f49b1805e85 (diff) | |
parent | e768ef944c88be1b18c995544c76fa931d9c5916 (diff) |
Fix issue #3
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |