diff options
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 |