Closed vitaly-krugl closed 12 years ago
As noted in the comments, the goal is to ensure that the protocol is adhered to while also re-raising the exception. The exceptions that you note should be reraised. Can you provide more detail on when and how that path fails?
Regarding "Spec says that channel should be closed if there's a framing error.", exceptions like SystemExit are not framing errors. SystemExit and friends are specifically not derived from Exception so that applications/libraries will just let them percolate unfettered. As far as I know, we should normally not be catching exceptions that do not inherit from Exception.
In a couple of places, haigha's exception handling is too broad, resulting in undesirable behavior for system-level exceptions such as SystemExit and GeventExit. Think of GeventExit and SystemExit like "kill -9".
Instead of "except:", these should be handling specific error classes that inherit from Exception. Ideally, these should be "except specific-expected-error-classes:", and at the minimum they should be "except Exception:", but never just "except:".
in haigha/channel.py, see the "except:" block below:
And in haigha/connection.py: