Improve error handling capabilities for single-threaded applications #89

Merged
merged 2 commits into from Jan 18, 2013

Projects

None yet

2 participants

@gdb
gdb commented Jan 18, 2013

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!

gdb added some commits Jan 18, 2013
@gdb gdb Raise a wrapped network error if not threaded 3f89a8d
@gdb gdb Where possible, don't rescue Exception
This allows single-threaded applications to set a Timeout and be
assured that no one will intercept it.
09fef22
@michaelklishin michaelklishin merged commit be122a2 into ruby-amqp:master Jan 18, 2013

1 check was pending

default The Travis build is in progress
Details
@michaelklishin
Member

LGTM, thank you Greg!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment