The first patch gives a single-threaded application the ability to handle network errors. The important part is the raise -- the NetworkErrorWrapper is useful for distinguishing network errors from other library errors, but I'd be happy to drop it. (It's not completely correct in any case, since there are a number of other socket call sites which aren't wrapped by handle_network_failure.)
The second patch removes the two rescue Exception clauses that a single-threaded application might hit. For my use-case, I'm setting a Timeout in the calling code, and need to make sure that Bunny doesn't swallow my raised Timeout.
What do you think? Thanks!
Raise a wrapped network error if not threaded
Where possible, don't rescue Exception
This allows single-threaded applications to set a Timeout and be
assured that no one will intercept it.
LGTM, thank you Greg!