Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more try/except around callbacks + TODO reviewed

  • Loading branch information...
commit b1fcf635f1414120155989d09ff354537270320e 1 parent 626274f
@paolo-losi authored
View
6 TODO
@@ -1,4 +1,10 @@
* review of all methods
+ - flow control
+ - queue.bind and queue.purge
+ - refactor queue_declare callback
+ - basic.return
+ - basic.recover?
+ - tx.select, tx.commit, tx.rollback
* check conn/channel status before sending frames
* logging
* handling of callback failures
View
5 stormed/connection.py
@@ -117,7 +117,10 @@ def close_stream(self):
def on_closed_stream(self):
if self.status != status.CLOSED:
if self.on_disconnect:
- self.on_disconnect()
+ try:
+ self.on_disconnect()
+ except Exception:
+ logger.error('ERROR in on_error() callback', exc_info=True)
def reset(self):
for c in self.channels:
View
8 stormed/method/channel.py
@@ -31,4 +31,10 @@ def handle(self, channel):
channel.reset()
error_code = id2constant.get(self.reply_code, '')
if channel.on_error:
- channel.on_error(ChannelError(error_code, self.reply_text, method))
+ try:
+ channel.on_error(ChannelError(error_code, self.reply_text, method))
+ except Exception:
+ logger.error('ERROR in on_error() callback for channel %d',
+ channel.channel_id, exc_info=True)
+
+# TODO flow control
View
6 stormed/method/connection.py
@@ -65,4 +65,8 @@ def handle(self, conn):
conn.reset()
error_code = id2constant.get(self.reply_code, '')
if conn.on_error:
- conn.on_error(ConnectionError(error_code, self.reply_text, method))
+ try:
+ conn.on_error(ConnectionError(error_code, self.reply_text, method))
+ except Exception:
+ logger.error('ERROR in on_error() callback', exc_info=True)
+
Please sign in to comment.
Something went wrong with that request. Please try again.