Permalink
Browse files

Pidbox: adds default on_decode_error handler

  • Loading branch information...
1 parent 055065d commit bed52922a75fabe858a3ade057ae878664ed960b @ask ask committed Feb 21, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 kombu/pidbox.py
View
@@ -85,9 +85,13 @@ def handler(self, fun):
self.handlers[fun.__name__] = fun
return fun
+ def on_decode_error(self, message, exc):
+ error('Cannot decode message: %r', exc, exc_info=1)
+
def listen(self, channel=None, callback=None):
consumer = self.Consumer(channel=channel,
- callbacks=[callback or self.handle_message])
+ callbacks=[callback or self.handle_message],
+ on_decode_error=self.on_decode_error)
consumer.consume()
return consumer

0 comments on commit bed5292

Please sign in to comment.