Skip to content

Commit

Permalink
Merge pull request #50 from mikebonnet/ignore-empty-body
Browse files Browse the repository at this point in the history
only try to json-decode the message body if it's non-empty
  • Loading branch information
ralphbean committed Mar 7, 2018
2 parents a5aee9f + 8895db3 commit 79d1a22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moksha.hub/moksha/hub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def consume_stomp_message(self, message):

# FIXME: only do this if the consumer wants it `jsonified`
try:
body = JSON.loads(message['body'])
if message['body']:
body = JSON.loads(message['body'])
else:
body = {}
except Exception as e:
log.warning('Cannot decode body from JSON: %s -> %r' % (e, message))
#body = {}
Expand Down

0 comments on commit 79d1a22

Please sign in to comment.