gomemcache
gomemcache copied to clipboard
ConnectTimeoutError should satisfy net.Error
I’m not quite sure why it was done this way, but gomemcache creates a ConnectTimeoutError
instead of the standard i/o timeout
or net.OpError
.
This, in turn, does not have the Timeout()
and Temporary()
methods to satisfy the net.Error
interface, obfuscating the error handling for clients.
In our library, we ended up recreating a net.OpError
: https://github.com/Shopify/goose/pull/35
Could you clarify why it was done way?
I would suggest getting rid of ConnectTimeoutError
and instead wrapping the poll.TimeoutError
in a net.OpError
to satisfy the interface and retain proper messaging.
@lavoiesl could this be related to the issue that I just posted here regarding lack of debugging information to go on?
https://github.com/bradfitz/gomemcache/issues/99
I'm really at a loss on how to process because it only says "connection timeout' and the docs say 'we shouldn't worry about this level of detail'. Not much help tbh.