Merge lp://staging/~free.ekanayaka/txamqp/distinguish-channel-and-connection-errors into lp://staging/txamqp

Proposed by Free Ekanayaka
Status: Merged
Merged at revision: 77
Proposed branch: lp://staging/~free.ekanayaka/txamqp/distinguish-channel-and-connection-errors
Merge into: lp://staging/txamqp
Diff against target: 450 lines (+129/-34)
8 files modified
setup.py (+1/-1)
src/txamqp/client.py (+22/-1)
src/txamqp/protocol.py (+13/-4)
src/txamqp/test/test_basic.py (+23/-7)
src/txamqp/test/test_broker.py (+3/-3)
src/txamqp/test/test_exchange.py (+26/-5)
src/txamqp/test/test_protocol.py (+29/-1)
src/txamqp/test/test_queue.py (+12/-12)
To merge this branch: bzr merge lp://staging/~free.ekanayaka/txamqp/distinguish-channel-and-connection-errors
Reviewer Review Type Date Requested Status
Alberto Donato (community) Approve
Review via email: mp+311633@code.staging.launchpad.net

Description of the change

Sub-class the generic txamqp.client.Closed error so it's easier to consuming code to distinguish between AMQP "channel" errors and "connection" errors (they have different semantics and happen under different circumstances, so you want to typically handle them differently).

Note that these are protocol-level errors, non transport-level ones (i.e. the TCP connection is still open after they happen).

While at it, some try/except blocks were migrated to py3-compatible syntax ("Exception, e:" vs "Exception as e:").

To post a comment you must log in.
90. By Free Ekanayaka

Use py3-compatible try/except syntax

Revision history for this message
Alberto Donato (ack) wrote :

nice, +1

just a few nits inline

review: Approve
Revision history for this message
Free Ekanayaka (free.ekanayaka) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: