Skip to content

Commit

Permalink
Catch and report if json parsing fails - using the reserved ':message…
Browse files Browse the repository at this point in the history
… => ' param in a process will do this :(
  • Loading branch information
lbt committed Apr 26, 2011
1 parent edb8f1f commit 6d79e9a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion RuoteAMQP/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ def __init__(self, ruote_queue,
def workitem_callback(self, msg):
"This is where a workitem message is handled"

self.workitem = Workitem(msg.body)
try:
self.workitem = Workitem(msg.body)
except ValueError, e:
print "Exception decoding incoming json"
print '-'*60
print msg.body
print '-'*60
print "Note: Now re-raising exception"
raise e

try:
self.consume()
except Exception, e:
Expand Down

0 comments on commit 6d79e9a

Please sign in to comment.