forked from platypush/platypush
Don't try to push a Pushbullet note body to the bus if it's not a valid JSON
This commit is contained in:
parent
54c3381ae3
commit
01006046e0
1 changed files with 7 additions and 3 deletions
|
@ -89,10 +89,14 @@ class PushbulletBackend(Backend):
|
||||||
self.logger.debug('Received push: {}'.format(push))
|
self.logger.debug('Received push: {}'.format(push))
|
||||||
|
|
||||||
body = push['body']
|
body = push['body']
|
||||||
try: body = json.loads(body)
|
try:
|
||||||
except ValueError as e: return # Some other non-JSON push
|
body = json.loads(body)
|
||||||
|
self.on_message(body)
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.debug(('Unexpected message received on the ' +
|
||||||
|
'Pushbullet backend: {}. Message: {}')
|
||||||
|
.format(str(e), body))
|
||||||
|
|
||||||
self.on_message(body)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.exception(e)
|
self.logger.exception(e)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue